Fix Ruff linter violations across the codebase#172
Conversation
yunzheng
left a comment
There was a problem hiding this comment.
Thanks for the PR, the example scripts were long overdue for this.
I added some small suggestions.
Applied examples/filesystem.py suggestions Co-authored-by: Yun Zheng Hu <hu@fox-it.com>
… into fix/ruff_errors
There was a problem hiding this comment.
There are still some tests failing when I run tox -e py3, could you look into this?
I think mainly due to some imports that have moved to global imports. If that caused the side effect I think for now it would be better to change it back and add a specific # noqa: flag to the inline import.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
==========================================
+ Coverage 82.90% 82.95% +0.05%
==========================================
Files 34 34
Lines 3592 3591 -1
==========================================
+ Hits 2978 2979 +1
+ Misses 614 612 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
You're right — I moved the imports back inside the functions since placing them at the top-level causes some tests to fail, though the exact reason isn't clear. The current version of Ruff doesn't flag these as violations, but newer versions do, so we should revisit this and possibly add # noqa once we upgrade. |
This PR addresses and fixes multiple Ruff linter warnings and errors to improve code quality and consistency across the project. The changes include:
tzparameters todatetime.now()calls to ensure timezone-aware datetimes (DTZ005).No functional changes were made — these updates are strictly linter-related.