mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
fix: Improve lint command behavior
This commit is contained in:
parent
d73d60ca5e
commit
9c2bd9d0a5
1 changed files with 3 additions and 3 deletions
|
@ -227,7 +227,7 @@ class Commands:
|
|||
self.coder.repo.commit(message=commit_message)
|
||||
|
||||
def cmd_lint(self, args="", fnames=None):
|
||||
"Lint and fix provided files or in-chat files if none provided"
|
||||
"Lint and fix in-chat files or all dirty files if none in chat"
|
||||
|
||||
if not self.coder.repo:
|
||||
self.io.tool_error("No git repository found.")
|
||||
|
@ -263,7 +263,7 @@ class Commands:
|
|||
continue
|
||||
|
||||
# Commit everything before we start fixing lint errors
|
||||
if self.coder.repo.is_dirty():
|
||||
if self.coder.repo.is_dirty() and self.coder.dirty_commits:
|
||||
self.cmd_commit("")
|
||||
|
||||
if not lint_coder:
|
||||
|
@ -278,7 +278,7 @@ class Commands:
|
|||
lint_coder.run(errors)
|
||||
lint_coder.abs_fnames = set()
|
||||
|
||||
if lint_coder and self.coder.repo.is_dirty():
|
||||
if lint_coder and self.coder.repo.is_dirty() and self.coder.auto_commits:
|
||||
self.cmd_commit("")
|
||||
|
||||
def cmd_clear(self, args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue