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
I was trying to use tryceratops to fix some issues in my codebase. I was specifically interested in fixing TRY200 and noticed that using --autofix didn't seem to actually do anything.
I was able to reproduce this problem with 2.3.2 and 2.2.0
I was able to confirm that--autofix was working with versions: 2.0.0, 2.1.0 and 2.1.1
Steps to Reproduce
Install tryceratops==2.3.2
Prepare file that intentionally violates TRY200, TRY201, and TRY400. (Taken from the documentation for each of those checks).
$ tryceratops --autofix repro.py[TRY400] Use logging '.exception' instead of '.error' - repro.py:23:8[TRY200] Use 'raise from' to specify exception cause - repro.py:8:8[TRY203] Useless try-except, remove it or handle the exception - repro.py:11:0[TRY201] Simply use 'raise' without specifying exception object again - repro.py:14:4Done processing!Processed 1 filesFound 4 violationsFixed 3 violations
Actual Behavior
$ tryceratops --autofix repro.py[TRY203] Useless try-except, remove it or handle the exception - repro.py:11:0[TRY400] Use logging '.exception' instead of '.error' - repro.py:23:8[TRY201] Simply use 'raise' without specifying exception object again - repro.py:14:4[TRY200] Use 'raise from' to specify exception cause - repro.py:8:8Done processing!Processed 1 filesFound 4 violations
Note the missing Fixed 3 violations
The text was updated successfully, but these errors were encountered:
Environment
Operating System: Ubuntu 22.04 (kernel 5.15.0-72-generic)
Tryceratops Version: 2.3.2 (But I've also observed this issue with 2.2.0)
pip list:
Describe the problem
I was trying to use
tryceratops
to fix some issues in my codebase. I was specifically interested in fixingTRY200
and noticed that using--autofix
didn't seem to actually do anything.I was able to reproduce this problem with 2.3.2 and 2.2.0
I was able to confirm that
--autofix
was working with versions: 2.0.0, 2.1.0 and 2.1.1Steps to Reproduce
Install tryceratops==2.3.2
Prepare file that intentionally violates
TRY200
,TRY201
, andTRY400
. (Taken from the documentation for each of those checks).Run
tryceratops --autofix repro.py
Expected Behavior
Actual Behavior
Note the missing
Fixed 3 violations
The text was updated successfully, but these errors were encountered: