Update Ruff and Fix Linting
Description
The pinned ruff version is super old by now. This PR updates ruff to the newest version and fixes all new rules that have been selected. This should probably be merged after 1.4.0 is released
Excluded Rules:
- FURB: Makes code a lot more complicated
- D413: Unnecessary newlines in docstrings
- RUF059: Allow unused variables because it is good to know which values are unpacked from content
- A004: It complains about
sys.exitshadowing python build-inexit(), which we have explicitly chose not to use
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] This requires a third party update (such as Impacket, Dploot, lsassy, etc)
- [x] LINTING
How Has This Been Tested?
coerce_plus and pfx auth were tested against GOAD, but before merging extensive testing should still be done.
Checklist:
- [x] I have ran Ruff against my changes (via poetry:
poetry run python -m ruff check . --preview, use--fixto automatically fix what it can) - [ ] New and existing e2e tests pass locally with my changes
- [x] My code follows the style guidelines of this project (should be covered by Ruff above)
- [ ] I have performed a self-review of my own code
I'll have to run FURB myself to see what changes it does, but from looking at it, it looks like its a good way to update old crappy code to modern Pythonic conventions.
I'll have to run
FURBmyself to see what changes it does, but from looking at it, it looks like its a good way to update old crappy code to modern Pythonic conventions.
Try it out, but i disabled 3 rules each after another, because imo they made the code much more complex and nonuniform.
E.g. this:
Not sure if using "Path" is much better when everyone is used to "open". Also half of the rules are "unstable", for now, so maybe not even here to stay?
If they're considered "unstable" yeah, probably not a good idea to use them. Path is the new way to use files with Python, so we should move to that.
If they're considered "unstable" yeah, probably not a good idea to use them. Path is the new way to use files with Python, so we should move to that.
Hmm okay maybe then it is worth to enable some of them. Haven't seen Path yet, but perhaps it's the way to go
Let the test run, everything good so far except the pso module, but that hangs in main as well: