You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running hatch fmt can move noqa comments to the wrong line when line-splitting. This caused me additional confusion because a second run of the formatter removed the now-extraneous noqa, and started showing me errors again.
Here is a minimal reproducer, used in a clean hatch new project. The first run of hatch fmt will reformat and return no other errors, but will split the noqa to the wrong line. A second run of hatch fmt will then strip the "invalid" noqa and start showing errors again.
def main():
some_list = [1, 2, 3]
another_list = []
if True:
if True:
for item in some_list:
another_list.append(generate_item( # noqa: PERF401 # Personal preference
item=item,
stuff=1))
def generate_item(item, stuff):
return item + stuff
Personally, the biggest usability issue for me was that the first fmt run returned no errors - I usually assume the code would be stable after a run of fmt with no errors.
Hatch version: 1.14.0
The text was updated successfully, but these errors were encountered:
Running
hatch fmt
can move noqa comments to the wrong line when line-splitting. This caused me additional confusion because a second run of the formatter removed the now-extraneous noqa, and started showing me errors again.Here is a minimal reproducer, used in a clean
hatch new
project. The first run ofhatch fmt
will reformat and return no other errors, but will split the noqa to the wrong line. A second run ofhatch fmt
will then strip the "invalid" noqa and start showing errors again.Personally, the biggest usability issue for me was that the first fmt run returned no errors - I usually assume the code would be stable after a run of fmt with no errors.
Hatch version: 1.14.0
The text was updated successfully, but these errors were encountered: