chore: ignore flake8 rules now handled by ruff#4703
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesFlake8 ignore list update
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Your deliverable: Test Execution Plan
Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.flake8:
- Around line 5-14: The comment in .flake8 incorrectly claims N815, N802, and
N818 are "now handled by ruff" but ruff won't run pep8-naming rules unless you
enable them; fix by either 1) rewriting the comment in .flake8 to explicitly
state these N rules are intentionally suppressed (give concise rationale for
N815, N802, N818) or 2) enable pep8-naming in ruff by adding a [tool.ruff.lint]
section to pyproject.toml with extend-select = ["N"] and then update the .flake8
ignore list and comments to reflect that naming rules are delegated to ruff
(ensure N815, N802, N818 handling is clear).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 8 🏁 Script executed: Length of output: 37 🏁 Script executed: Length of output: 755 🏁 Script executed: Length of output: 41 🏁 Script executed: Length of output: 1735 |
81c5264 to
27db267
Compare
Remove max-line-length (ruff formatter manages line length). Add ignore rules to .flake8 for two categories: Rules handled by ruff formatter (ruff removes noqa for these, causing flake8 CI failures): - E501: line too long (ruff formatter manages line length) - E201: whitespace after bracket (ruff formatter manages this) - W503: line break before binary operator (PEP 8 reversed) - F821: undefined name (global_config files use dynamic exec()) Intentionally suppressed naming rules (not enforced by either linter — these patterns are valid in this codebase): - N815: camelCase in dataclass fields matching K8s API schemas - N802: method overrides like formatTime from logging.Formatter - N818: existing exception names like MissingTemplateVariables Also add with_suffix and writelines to fcn_exclude_functions to prevent FCN001 false positives on standard library calls. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Your deliverable: Test Execution Plan
Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1735 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
…#4720) ##### What this PR does / why we need it: Adds ignore rules to `pyproject.toml` for ruff preview rules exposed by `preview = true` that require careful per-file refactoring. Each rule is marked with a TODO to be addressed in a dedicated follow-up PR. **Rules ignored:** | Rule | Description | Why ignored | |------|-------------|-------------| | SIM102 | collapsible-if | Nested ifs are often more readable | | SIM114 | combine if branches | Reduces readability | | SIM117 | nested with statements | Existing pattern, keep as-is | | C419 | unnecessary comprehension in call | May change list vs generator semantics | | RUF015 | unnecessary iterable allocation | Changes exception type | | DTZ005/006/007 | datetime without timezone | Requires careful refactoring | | BLE001 | blind exception catch | Pre-existing, fix separately | | PYI034/036 | __enter__/__exit__ annotations | Needs type annotation work | | EXE001/002 | shebang/executable mismatch | Needs per-file review | | F821 | undefined name | Used in global_config files (dynamic loading) | | PLE0643 | likely IndexError | Needs per-case review | | PLW0604 | redundant global at module level | Used in global_config files | | PLW1510 | subprocess.run without check | Needs per-call review | | B005/018/023 | various bugbear rules | Intent-dependent | | G201 | .error(exc_info=True) vs .exception() | Needs per-call review | | SIM115 | context manager for file opening | May need structural changes | Part 2 of a 6-PR series to clean up lint configuration and apply safe fixes: 1. `.flake8` ignore rules (#4703) 2. **This PR** — `pyproject.toml` ruff ignore rules 3. Remove stale `# noqa` comments (depends on PRs 1+2) 4. Remove obsolete utf-8 coding headers 5. Apply safe ruff fixes repo-wide (SIM118, SIM201, PLC0206, etc.) 6. Bump pre-commit hooks (ruff v0.15.12, mypy v1.20.2) Assisted-by: Claude <noreply@anthropic.com> ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: No code changes — config only. All pre-commit hooks pass on all files. ##### jira-ticket: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated code linting configuration settings. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: rnetser <rnetser@redhat.com>
##### What this PR does / why we need it: Two cleanups in one PR: **1. Remove stale `# noqa` comments** that no linter enforces after .flake8 (#4703) and pyproject.toml (#4720) configuration changes: | Rule | Reason noqa is stale | |------|---------------------| | F821 | Scoped to `tests/global_config*.py` via ruff `per-file-ignores` (#4720) | | N802 | Flake8 no longer checks this (#4703) | | E501 | Ruff formatter manages line length | | E201 | Ruff formatter manages whitespace | **N815 (`camelCase` in class scope) noqa comments are intentionally kept** — flake8 still enforces N815. The existing `# noqa: N815` comments on dataclass fields matching Kubernetes API schemas remain in place. N815 was also **removed from the flake8 ignore list** to restore enforcement. `utilities/unittests/` E402 noqa comments are also kept — E402 is not globally ignored and these files use `sys.path` manipulation before imports. **2. Remove obsolete `# -*- coding: utf-8 -*-` headers** — Python 3 uses UTF-8 by default (PEP 3120), making these headers unnecessary (ruff UP009). Part 3 of a 5-PR lint cleanup series: 1. `.flake8` ignore rules (#4703) ✅ merged 2. `pyproject.toml` ruff ignore rules (#4720) ✅ merged 3. **This PR** — remove stale noqa + utf-8 headers 4. Apply safe ruff fixes repo-wide (SIM118, SIM201, PLC0206, etc.) 5. Bump pre-commit hooks (ruff v0.15.12, mypy v1.20.2) Assisted-by: Claude <noreply@anthropic.com> ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: All changes are comment/header removals — zero behavioral changes. N815 enforcement is restored (removed from flake8 ignore list). ##### jira-ticket: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed legacy UTF-8 encoding declarations from test files. * Removed redundant linter-suppression comments across codebase. * Updated linting configuration to improve code quality standards. * **Style** * Reformatted test assertions for improved readability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: rnetser <rnetser@redhat.com>
Ruff v0.15.x handles several rules with better context awareness than flake8 (dataclass fields, method overrides, formatter-managed line length). When ruff removes inline `# noqa` comments it considers unnecessary, flake8 still enforces those rules, causing CI conflicts. This PR ignores those rules in `.flake8` to prevent conflicts between the two linters: - **N815**: camelCase in class scope — ruff understands dataclass fields matching API schemas - **N802**: function name should be lowercase — ruff understands method overrides (e.g. `formatTime`) - **E501**: line too long — ruff formatter manages line length - **F821**: undefined name — used in global_config files with dynamic `exec()` loading - **E201**: whitespace after `(` — ruff formatter manages whitespace - **W503**: line break before binary operator — PEP 8 reversed this; ruff uses W504 (after) - **N818**: exception name should end with Error — ruff allows existing names like `MissingTemplateVariables` Also adds `with_suffix` and `writelines` to `fcn_exclude_functions` to prevent FCN001 false positives on standard library calls. Part 1 of a 6-PR series to clean up lint configuration and apply safe fixes: 1. **This PR** — `.flake8` ignore rules 2. `pyproject.toml` ruff ignore rules for preview rules 3. Remove stale `# noqa` comments (depends on PRs 1+2) 4. Remove obsolete utf-8 coding headers 5. Apply safe ruff fixes repo-wide (SIM118, SIM201, PLC0206, etc.) 6. Bump pre-commit hooks (ruff v0.15.12, mypy v1.20.2) Assisted-by: Claude <noreply@anthropic.com> Replaces RedHatQE#4701 with a smaller, incremental approach. No code changes — config only. All pre-commit hooks pass on all files. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> * **Chores** * Updated linting configuration: removed hard line-length enforcement in favor of centralized formatting, suppressed a targeted set of stylistic and specific error checks, and added inline notes clarifying that certain rules (including line-length and whitespace checks) are managed by the code formatter. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: rnetser <rnetser@redhat.com>
…E#4725) ##### What this PR does / why we need it: Two cleanups in one PR: **1. Remove stale `# noqa` comments** that no linter enforces after .flake8 (RedHatQE#4703) and pyproject.toml (RedHatQE#4720) configuration changes: | Rule | Reason noqa is stale | |------|---------------------| | F821 | Scoped to `tests/global_config*.py` via ruff `per-file-ignores` (RedHatQE#4720) | | N802 | Flake8 no longer checks this (RedHatQE#4703) | | E501 | Ruff formatter manages line length | | E201 | Ruff formatter manages whitespace | **N815 (`camelCase` in class scope) noqa comments are intentionally kept** — flake8 still enforces N815. The existing `# noqa: N815` comments on dataclass fields matching Kubernetes API schemas remain in place. N815 was also **removed from the flake8 ignore list** to restore enforcement. `utilities/unittests/` E402 noqa comments are also kept — E402 is not globally ignored and these files use `sys.path` manipulation before imports. **2. Remove obsolete `# -*- coding: utf-8 -*-` headers** — Python 3 uses UTF-8 by default (PEP 3120), making these headers unnecessary (ruff UP009). Part 3 of a 5-PR lint cleanup series: 1. `.flake8` ignore rules (RedHatQE#4703) ✅ merged 2. `pyproject.toml` ruff ignore rules (RedHatQE#4720) ✅ merged 3. **This PR** — remove stale noqa + utf-8 headers 4. Apply safe ruff fixes repo-wide (SIM118, SIM201, PLC0206, etc.) 5. Bump pre-commit hooks (ruff v0.15.12, mypy v1.20.2) Assisted-by: Claude <noreply@anthropic.com> ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: All changes are comment/header removals — zero behavioral changes. N815 enforcement is restored (removed from flake8 ignore list). ##### jira-ticket: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed legacy UTF-8 encoding declarations from test files. * Removed redundant linter-suppression comments across codebase. * Updated linting configuration to improve code quality standards. * **Style** * Reformatted test assertions for improved readability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: rnetser <rnetser@redhat.com>
Ruff v0.15.x handles several rules with better context awareness than flake8 (dataclass fields, method overrides, formatter-managed line length). When ruff removes inline `# noqa` comments it considers unnecessary, flake8 still enforces those rules, causing CI conflicts. This PR ignores those rules in `.flake8` to prevent conflicts between the two linters: - **N815**: camelCase in class scope — ruff understands dataclass fields matching API schemas - **N802**: function name should be lowercase — ruff understands method overrides (e.g. `formatTime`) - **E501**: line too long — ruff formatter manages line length - **F821**: undefined name — used in global_config files with dynamic `exec()` loading - **E201**: whitespace after `(` — ruff formatter manages whitespace - **W503**: line break before binary operator — PEP 8 reversed this; ruff uses W504 (after) - **N818**: exception name should end with Error — ruff allows existing names like `MissingTemplateVariables` Also adds `with_suffix` and `writelines` to `fcn_exclude_functions` to prevent FCN001 false positives on standard library calls. Part 1 of a 6-PR series to clean up lint configuration and apply safe fixes: 1. **This PR** — `.flake8` ignore rules 2. `pyproject.toml` ruff ignore rules for preview rules 3. Remove stale `# noqa` comments (depends on PRs 1+2) 4. Remove obsolete utf-8 coding headers 5. Apply safe ruff fixes repo-wide (SIM118, SIM201, PLC0206, etc.) 6. Bump pre-commit hooks (ruff v0.15.12, mypy v1.20.2) Assisted-by: Claude <noreply@anthropic.com> Replaces RedHatQE#4701 with a smaller, incremental approach. No code changes — config only. All pre-commit hooks pass on all files. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> * **Chores** * Updated linting configuration: removed hard line-length enforcement in favor of centralized formatting, suppressed a targeted set of stylistic and specific error checks, and added inline notes clarifying that certain rules (including line-length and whitespace checks) are managed by the code formatter. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: rnetser <rnetser@redhat.com> Signed-off-by: Adam Cinko <acinko@redhat.com>
…E#4725) ##### What this PR does / why we need it: Two cleanups in one PR: **1. Remove stale `# noqa` comments** that no linter enforces after .flake8 (RedHatQE#4703) and pyproject.toml (RedHatQE#4720) configuration changes: | Rule | Reason noqa is stale | |------|---------------------| | F821 | Scoped to `tests/global_config*.py` via ruff `per-file-ignores` (RedHatQE#4720) | | N802 | Flake8 no longer checks this (RedHatQE#4703) | | E501 | Ruff formatter manages line length | | E201 | Ruff formatter manages whitespace | **N815 (`camelCase` in class scope) noqa comments are intentionally kept** — flake8 still enforces N815. The existing `# noqa: N815` comments on dataclass fields matching Kubernetes API schemas remain in place. N815 was also **removed from the flake8 ignore list** to restore enforcement. `utilities/unittests/` E402 noqa comments are also kept — E402 is not globally ignored and these files use `sys.path` manipulation before imports. **2. Remove obsolete `# -*- coding: utf-8 -*-` headers** — Python 3 uses UTF-8 by default (PEP 3120), making these headers unnecessary (ruff UP009). Part 3 of a 5-PR lint cleanup series: 1. `.flake8` ignore rules (RedHatQE#4703) ✅ merged 2. `pyproject.toml` ruff ignore rules (RedHatQE#4720) ✅ merged 3. **This PR** — remove stale noqa + utf-8 headers 4. Apply safe ruff fixes repo-wide (SIM118, SIM201, PLC0206, etc.) 5. Bump pre-commit hooks (ruff v0.15.12, mypy v1.20.2) Assisted-by: Claude <noreply@anthropic.com> ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: All changes are comment/header removals — zero behavioral changes. N815 enforcement is restored (removed from flake8 ignore list). ##### jira-ticket: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed legacy UTF-8 encoding declarations from test files. * Removed redundant linter-suppression comments across codebase. * Updated linting configuration to improve code quality standards. * **Style** * Reformatted test assertions for improved readability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: rnetser <rnetser@redhat.com> Signed-off-by: Adam Cinko <acinko@redhat.com>
What this PR does / why we need it:
Ruff v0.15.x handles several rules with better context awareness than flake8 (dataclass fields, method overrides, formatter-managed line length). When ruff removes inline
# noqacomments it considers unnecessary, flake8 still enforces those rules, causing CI conflicts.This PR ignores those rules in
.flake8to prevent conflicts between the two linters:formatTime)exec()loading(— ruff formatter manages whitespaceMissingTemplateVariablesAlso adds
with_suffixandwritelinestofcn_exclude_functionsto prevent FCN001 false positives on standard library calls.Part 1 of a 6-PR series to clean up lint configuration and apply safe fixes:
.flake8ignore rulespyproject.tomlruff ignore rules for preview rules# noqacomments (depends on PRs 1+2)Assisted-by: Claude noreply@anthropic.com
Which issue(s) this PR fixes:
Replaces #4701 with a smaller, incremental approach.
Special notes for reviewer:
No code changes — config only. All pre-commit hooks pass on all files.
jira-ticket:
Summary by CodeRabbit