Updated lint command to commit after fixing problems.

This commit is contained in:
Paul Gauthier 2024-05-18 19:30:32 -07:00
parent 828a5264b0
commit bc06d8623c
3 changed files with 4 additions and 4 deletions

View file

@ -312,9 +312,9 @@ def get_parser(default_config_files, git_root):
default=False,
)
group.add_argument(
"--lint",
"--lint-and-commit",
action="store_true",
help="Run the linter on all dirty files, fix problems and then commit.",
help="Commit, run the linter on all dirty files, fix problems and commit again",
default=False,
)

View file

@ -154,7 +154,7 @@ class Commands:
self.coder.repo.commit(message=commit_message)
def cmd_lint(self, args):
"Run the linter on all dirty files, fix problems and then commit"
"Commit, run the linter on all dirty files, fix problems and commit again"
if not self.coder.repo:
self.io.tool_error("No git repository found.")

View file

@ -355,7 +355,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
coder.commands.cmd_commit("")
return
if args.lint:
if args.lint_and_commit:
coder.commands.cmd_lint("")
return