-
Hello @ofek, I've started using hatch recently and am so far happy with it! One thing that perplexed me today: $ hatch --version
Hatch, version 1.9.1
$ hatch fmt
my/file.py:36:101: E501 Line too long (119 > 100)
Found 1 error. If I run the sequence: $ hatch fmt -f
1 file reformatted, 5 files left unchanged
$ hatch fmt -l
# no errors all is hunky-dory as the formatter has already wrapped the too-long line. Checking the code, the linter will be started first: commands: list[list[str]] = []
if not formatter:
commands.append(environment.get_linter_command(*args, check=check, preview=preview)) # linter first
if not linter:
commands.append(environment.get_formatter_command(*args, check=check, preview=preview))
with app.project.location.as_cwd(), internal_env.command_context():
if not environment.config_path or sync:
environment.write_config_file(preview=preview)
for command in commands:
process = app.platform.run_command(command)
if process.returncode:
app.abort(code=process.returncode) On the I have always run |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I do this deliberately because fixing linting errors has no guarantee of adhering to formatting settings. The line too long is unfortunately the only case that I know of where you are forced to use the formatting flag to fix. |
Beta Was this translation helpful? Give feedback.
I do this deliberately because fixing linting errors has no guarantee of adhering to formatting settings. The line too long is unfortunately the only case that I know of where you are forced to use the formatting flag to fix.