Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change linter to Ruff #52

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Change linter to Ruff #52

merged 4 commits into from
Oct 15, 2024

Conversation

Schamper
Copy link
Member

@Schamper Schamper commented Jul 26, 2024

Initial attempt at using a Ruff-based linting configuration with a number of rules that should apply to the Dissect codebase.

Some that are maybe worth enabling down the line, maybe with some rules ignored or only applied to certain files:

  • pep8-naming (N)
  • pydocstyle (D)
  • flake8-bandit (S)

Reference: https://docs.astral.sh/ruff/rules/

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 82.72727% with 19 lines in your changes missing coverage. Please review.

Project coverage is 86.25%. Comparing base (5e3e6b4) to head (c861e90).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/util/plist.py 75.75% 8 Missing ⚠️
dissect/util/tools/dump_nskeyedarchiver.py 0.00% 5 Missing ⚠️
dissect/util/xmemoryview.py 77.77% 2 Missing ⚠️
dissect/util/compression/lzxpress.py 75.00% 1 Missing ⚠️
dissect/util/encoding/surrogateescape.py 0.00% 1 Missing ⚠️
dissect/util/stream.py 90.90% 1 Missing ⚠️
dissect/util/ts.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   86.46%   86.25%   -0.22%     
==========================================
  Files          20       20              
  Lines        1286     1302      +16     
==========================================
+ Hits         1112     1123      +11     
- Misses        174      179       +5     
Flag Coverage Δ
unittests 86.25% <82.72%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@twiggler twiggler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested Ruff for a couple of days and I like it. It is fast, and greatly improves the Developer Experience.

I also agree with the linting configuration.

I do think that more people should review the configuration, and perhaps have a discussion about them. Everyone should be onboard.

Moreover, we need a plan how to to enable this for all projects. I imagine this is quite some work.

tests/test_sid.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
@Schamper Schamper merged commit 6288ce3 into main Oct 15, 2024
18 of 20 checks passed
@Schamper Schamper deleted the ruff branch October 15, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants