chore(checks): Init wemake-python-styleguide configuration#905
chore(checks): Init wemake-python-styleguide configuration#905MaxymVlasov merged 18 commits intomasterfrom
Conversation
📝 WalkthroughSummary by CodeRabbit
Summary by CodeRabbit
WalkthroughLinting configurations were updated by adding wemake-python-styleguide (WPS) rules to pre-commit and Ruff, introducing a Flake8 config, and applying or justifying new noqa suppressions for WPS codes in the codebase. Minor refactoring included changing a list to a tuple and renaming an exception variable for clarity. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Pre-commit
participant Ruff
participant Flake8
participant WPS
Developer->>Pre-commit: Run hooks before commit
Pre-commit->>Ruff: Lint code (with WPS as external)
Pre-commit->>Flake8: Lint code (with WPS plugin)
Flake8->>WPS: Apply WPS style checks
Ruff->>Developer: Report linting results (preserve WPS-specific noqa)
Flake8->>Developer: Report linting results (WPS and other plugins)
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 #905 +/- ##
=======================================
Coverage 96.55% 96.55%
=======================================
Files 10 10
Lines 261 261
Branches 7 7
=======================================
Hits 252 252
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. |
5b6bf8a to
93cc4b8
Compare
62870fd to
2a1c406
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
setup.cfg (1)
21-21: Correct typos in comments.There's a typo in the per-file-ignores comment: "coplexity" should be "complexity" and "depprecated" should be "deprecated".
- # We will not spend time on fixing coplexity in depprecated hook + # We will not spend time on fixing complexity in deprecated hook
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
ruff.toml(1 hunks)setup.cfg(1 hunks)src/pre_commit_terraform/_cli.py(1 hunks)src/pre_commit_terraform/terraform_docs_replace.py(3 hunks)
🔇 Additional comments (6)
ruff.toml (1)
19-21: Approve treating WPS as external.Adding
external = ["WPS"]under[lint]ensures Ruff will preserve WPS-specific# noqacomments and not strip them, aligning with the PR’s goal of integrating wemake-python-styleguide suppressions.src/pre_commit_terraform/_cli.py (2)
36-37: Approve suppression of excessive except blocks.Applying
# noqa: WPS225to thetry:block is appropriate to bypass the "too many except cases" check in this isolated context.
39-41: Approve print suppression.Adding
# noqa: T201,WPS421to the errorsrc/pre_commit_terraform/terraform_docs_replace.py (3)
61-61: Approve WPS231 suppression on signature.Using
# noqa: WPS231on the function signature correctly silences the complexity warning for this deprecated hook.
89-89: Approve WPS229 suppression on try block.Suppressing
# noqa: WPS229on thetry:statement is acceptable in this legacy context.
110-112: Approve inline exception suppressions.Inline
# noqa: PERF203,WPS111on the except clause and# noqa: T201,WPS421on the
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.pre-commit-config.yaml (1)
115-119: Group Python lint hooks for maintainability
To keep all Python linters in one place, consider moving thewemake-python-styleguideblock immediately afterruff-formatunder the Python section. You can also add alanguage_version: python3(or your supported version) to ensure the correct interpreter is used.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.flake8(1 hunks).pre-commit-config.yaml(1 hunks)src/pre_commit_terraform/_cli_subcommands.py(1 hunks)src/pre_commit_terraform/_structs.py(1 hunks)src/pre_commit_terraform/_types.py(1 hunks)src/pre_commit_terraform/terraform_docs_replace.py(3 hunks)
✅ Files skipped from review due to trivial changes (4)
- src/pre_commit_terraform/_structs.py
- src/pre_commit_terraform/_types.py
- src/pre_commit_terraform/_cli_subcommands.py
- .flake8
🚧 Files skipped from review as they are similar to previous changes (1)
- src/pre_commit_terraform/terraform_docs_replace.py
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: 🧪 Tests / pytest@🐍3.9@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.13@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.13@macos-13
- GitHub Check: 🧪 Tests / pytest@🐍3.12@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.12@ubuntu-24.04
- GitHub Check: 🧪 Tests / pytest@🐍3.12@macos-14
- GitHub Check: 🧪 Tests / pytest@🐍3.11@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.10@windows-2025
- GitHub Check: 🧪 Tests / pytest@🐍3.10@macos-13
- GitHub Check: 🧹 Linters / pre-commit@🐍3.13@ubuntu-latest
🔇 Additional comments (1)
.pre-commit-config.yaml (1)
115-119: Pin exact revision for wemake-python-styleguide
Good job pinning the hook to a specific commit, aligning with the project’s reproducibility strategy.
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
for more information, see https://pre-commit.ci
c12c94b to
6eb082a
Compare
|
This PR is included in version 1.99.5 🎉 |
Description of your changes