-
-
Notifications
You must be signed in to change notification settings - Fork 567
chore(linters): Introduce ruff and fix issues #831
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
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis pull request introduces a new pre-commit hook repository for Python linting by adding two Ruff hooks—one with an auto-fix argument and one for formatting—into the pre-commit configuration. It also adds a new Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Git as Git Commit Process
participant PC as Pre-commit Framework
participant Ruff as Ruff Linter
participant Formatter as Ruff-Format Hook
Dev->>Git: Initiate commit
Git->>PC: Trigger pre-commit hooks
PC->>Ruff: Run Ruff hook (--fix)
Ruff-->>PC: Return linting results & auto-fixed code
PC->>Formatter: Run Ruff-format hook
Formatter-->>PC: Return formatting results
PC-->>Git: Validate commit (pass/fail)
Git-->>Dev: Complete commit
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Note 🎁 Summarized by CodeRabbit FreeYour organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #831 +/- ##
=======================================
Coverage 98.44% 98.44%
=======================================
Files 28 28
Lines 578 578
Branches 17 17
=======================================
Hits 569 569
Misses 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
unrelated is a separate PR. blame ignore is a separate PR. Plus I noticed reshuffling logic which is another one. So it's like 6 PRs. |
Also, plan for adding https://wemake-python-styleguide.rtfd.io on top after all this. |
from subprocess import CalledProcessError | ||
from argparse import ArgumentParser | ||
from argparse import Namespace | ||
from subprocess import CalledProcessError # noqa: S404. We invoke cli tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subprocess interaction should probably be quarantined in a dedicated module where these noqas would be allowed and nowhere else. That module should implement wrappers that the rest of the project would call. This design allows keeping all potentially dangerous code in one place that you can be extra careful about.
5425111
to
209b9dd
Compare
4f66e0f
to
f74ef59
Compare
All those noqas could've gone into a separate PR, I think. Or into that manual one. You can split them out or enclose all the justifications here. |
This PR is included in version 1.98.1 🎉 |
TBD:
After @webknjaz will approve config, split to 4 PRs:
git blame
to s.2