Skip to content

Ruff linting#32

Merged
Miauwkeru merged 27 commits intofox-it:mainfrom
william-billaud:ruff_linting
Apr 24, 2026
Merged

Ruff linting#32
Miauwkeru merged 27 commits intofox-it:mainfrom
william-billaud:ruff_linting

Conversation

@william-billaud
Copy link
Copy Markdown
Contributor

This PR replace flake/blake/isort with ruff, as used in other dissect project.

Partially fix #26
This would require additional works, especially regarding typing but this will probably be easier to review in a different PR.

Regarding Ignored rules, I have the following statistics of what should be fixed if PT, ANN, RUF AND C4 are enabled.

  • 105 ANN001 missing-type-function-argument
  • 76 ANN201 missing-return-type-undocumented-public-function
  • 18 ANN202 missing-return-type-private-function
  • 6 RUF005 collection-literal-concatenation
  • 5 C416 unnecessary-comprehension
  • 5 PT019 pytest-fixture-param-without-value
  • 2 ANN206 missing-return-type-class-method
  • 2 C417 unnecessary-map
  • 1 RUF012 mutable-class-default

I do not plan to work on it in a near time and fixing some of these issue would require dig more in the codebase, to ensure it does not break anything.
Even if it does not fully fix the issue, is better than nothing. IMO Original issue should be amended to specify work left to do, and this commit added to .git-blame-ignore-revs

@Schamper
Copy link
Copy Markdown
Member

Please don't spend too much time on dissect.eventlog for your own sake. I plan to completely rewrite this in the near-ish future (before we go monorepo).

@william-billaud
Copy link
Copy Markdown
Contributor Author

william-billaud commented Mar 24, 2026

I do not plan to spend more time in a near future, and for most repo it took me 5 to 15 minutes to fork + creates issues + make change + PR, this one took me maybe 30 or 45 minutes, this is OK.

But let me know if there is some other repos with heavy rework planned before monorepo that I should skip.

@Schamper
Copy link
Copy Markdown
Member

But let me know if there is some other repos with heavy rework planned before monorepo that I should skip.

This should be the only one!

Comment thread pyproject.toml Outdated
Comment thread tox.ini
william-billaud and others added 4 commits March 26, 2026 09:15
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
@Miauwkeru
Copy link
Copy Markdown
Contributor

@Schamper is there anything else that needs to be done on this pr? I am going to change this project in the style of the other projects and thought of using these changes as a base

@Miauwkeru
Copy link
Copy Markdown
Contributor

I pushed the other changes to completely fix the ruff linting to this branch. It also contains the typehints, tho those are up to change once the actual refactoring of the project takes place.

@Miauwkeru Miauwkeru requested a review from Schamper April 15, 2026 09:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 80.64516% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.28%. Comparing base (2097afb) to head (185234c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/eventlog/wevtutil.py 0.00% 36 Missing ⚠️
dissect/eventlog/bxml/bxml.py 90.21% 9 Missing ⚠️
dissect/eventlog/wevt/wevt_object.py 89.33% 8 Missing ⚠️
dissect/eventlog/evtx/evtx.py 63.63% 4 Missing ⚠️
dissect/eventlog/wevt/wevt.py 95.45% 2 Missing ⚠️
dissect/eventlog/evt/evt.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
+ Coverage   80.90%   81.28%   +0.38%     
==========================================
  Files           9       17       +8     
  Lines         885      919      +34     
==========================================
+ Hits          716      747      +31     
- Misses        169      172       +3     
Flag Coverage Δ
unittests 81.28% <80.64%> (+0.38%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 20, 2026

Merging this PR will not alter performance

✅ 10 untouched benchmarks


Comparing william-billaud:ruff_linting (185234c) with main (2097afb)

Open in CodSpeed

Comment thread dissect/eventlog/wevtutil.py
Comment thread dissect/eventlog/wevtutil.py Outdated
Comment thread examples/scrape_evt.py Outdated
Comment thread dissect/eventlog/wevt/wevt_object.py Outdated
Comment thread dissect/eventlog/bxml/__init__.py
@Miauwkeru Miauwkeru requested a review from twiggler April 22, 2026 14:28

if TYPE_CHECKING:
from dissect.eventlog.utils import KeyValueCollection

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I was wondering, do we have references to documentation explaning what these classes model?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added a docstring with a reference to what I initially used to get to these answers

@Miauwkeru Miauwkeru dismissed Schamper’s stale review April 24, 2026 07:35

issues resolved

@Miauwkeru Miauwkeru merged commit a68e54a into fox-it:main Apr 24, 2026
23 of 24 checks passed
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.

Change linter to Ruff

4 participants