style: remove stale noqa comments and obsolete utf-8 headers#4725
Conversation
Remove inline noqa suppressions that no linter enforces after .flake8 (RedHatQE#4703) and pyproject.toml (RedHatQE#4720) configuration changes: - F821: undefined name — scoped to global_config via per-file-ignores - N802: function name override — flake8 no longer checks this - E501: line too long — ruff formatter manages line length - E201: whitespace after bracket — ruff formatter manages this N815 (camelCase in class scope) noqa comments are kept — flake8 still enforces N815 for dataclass fields matching K8s API schemas. Also removes obsolete # -*- coding: utf-8 -*- headers (Python 3 uses UTF-8 by default per PEP 3120). Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4725 +/- ##
==========================================
+ Coverage 98.63% 98.67% +0.03%
==========================================
Files 25 25
Lines 2420 2483 +63
==========================================
+ Hits 2387 2450 +63
Misses 33 33
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:
|
|
Tip For best results, initiate chat on the files or code changes.
I'll resolve these comments and record the patterns for future reviews. [resolve] ✏️ Learnings added
|
|
/approve |
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: 3952 🏁 Script executed: Length of output: 1788 |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
…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>
…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:
Two cleanups in one PR:
1. Remove stale
# noqacomments that no linter enforces after .flake8 (#4703) and pyproject.toml (#4720) configuration changes:tests/global_config*.pyvia ruffper-file-ignores(#4720)N815 (
camelCasein class scope) noqa comments are intentionally kept — flake8 still enforces N815. The existing# noqa: N815comments 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 usesys.pathmanipulation 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:
.flake8ignore rules (chore: ignore flake8 rules now handled by ruff #4703) ✅ mergedpyproject.tomlruff ignore rules (chore: add ruff ignore rules for preview rules needing separate fixes #4720) ✅ mergedAssisted-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:
Summary by CodeRabbit
Chores
Style