Skip to content
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

(Mostly) Replace flake8 with Ruff #18801

Merged
merged 6 commits into from
Nov 1, 2024
Merged

Conversation

Quexington
Copy link
Contributor

@Quexington Quexington commented Oct 30, 2024

See PR #18759 for more information about Ruff. This PR continues the work of simplifying our pre-commit workflow by (mostly) replacing another one of our tools with Ruff.

This only takes a partial step towards eliminating flake8 for auditability reasons. One difference between flake8 and Ruff is that Ruff is more strict wrt unused variables in that it does not allow them even during tuple deconstructions. There's been some debate about whether this should be a separate rule: astral-sh/ruff#8884 but for now, it all lives under the same code. We don't want to ignore that code generally, but there's approximately 540 errors to fix if we switch to linting it with Ruff. In order to preserve PR and code history auditability, I'll follow up with a PR to fix those errors by themselves so that the other rules that are applied can be viewed in this PR.

@Quexington Quexington added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Oct 30, 2024
@Quexington Quexington changed the title Replace flake8 with Ruff (Mostly) Replace flake8 with Ruff Oct 31, 2024
Base automatically changed from quex.replace_pyupgrade_with_ruff to main October 31, 2024 18:56
@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Oct 31, 2024
@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Oct 31, 2024
@Chia-Network Chia-Network deleted a comment from github-actions bot Oct 31, 2024
@Chia-Network Chia-Network deleted a comment from github-actions bot Oct 31, 2024
@Quexington Quexington marked this pull request as ready for review October 31, 2024 19:35
@Quexington Quexington requested a review from a team as a code owner October 31, 2024 19:35
Copy link
Contributor

File Coverage Missing Lines
chia/_tests/util/benchmark_cost.py 0.0% lines 170
chia/full_node/full_node.py 66.7% lines 1144
chia/plotting/check_plots.py 0.0% lines 164-165
chia/util/profiler.py 0.0% lines 180
chia/util/task_timing.py 0.0% lines 251
Total Missing Coverage
27 lines 6 lines 77%

Copy link

Pull Request Test Coverage Report for Build 11618368919

Details

  • 21 of 27 (77.78%) changed or added relevant lines in 15 files are covered.
  • 21 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.008%) to 90.868%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/_tests/util/benchmark_cost.py 0 1 0.0%
chia/full_node/full_node.py 2 3 66.67%
chia/util/profiler.py 0 1 0.0%
chia/util/task_timing.py 0 1 0.0%
chia/plotting/check_plots.py 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
chia/daemon/keychain_proxy.py 1 73.16%
chia/full_node/pending_tx_cache.py 1 96.55%
chia/farmer/farmer.py 1 72.52%
chia/server/node_discovery.py 1 79.82%
chia/daemon/client.py 1 73.49%
chia/timelord/timelord_launcher.py 2 70.71%
chia/rpc/rpc_server.py 3 88.0%
chia/timelord/timelord.py 11 78.8%
Totals Coverage Status
Change from base Build 11618130161: 0.008%
Covered Lines: 102710
Relevant Lines: 112805

💛 - Coveralls

@emlowe
Copy link
Contributor

emlowe commented Nov 1, 2024

Coverage exemption

@Quexington Quexington added the ready_to_merge Submitter and reviewers think this is ready label Nov 1, 2024
@pmaslana pmaslana merged commit 0e703e4 into main Nov 1, 2024
363 of 364 checks passed
@pmaslana pmaslana deleted the quex.replace_flake8_with_ruff branch November 1, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog ready_to_merge Submitter and reviewers think this is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants