Page MenuHomePhabricator

[lint] replace flake8 with ruff
ClosedPublic

Authored by PiRK on Fri, Nov 7, 15:54.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC34100ffa6547: [lint] replace flake8 with ruff
Summary

As per title

Depends on D18914

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

arcanist/linter/RuffCheckLinter.php
95 ↗(On Diff #56517)

some of the previous ignored rules don't even exist in Ruff. And C901 is a flake8 plugin we don't use which uses the same C prefix as rules from flake8-comprehensions.

97 ↗(On Diff #56517)

A is for flake8-builtins, C for flake8-comprehensions. E and F are the basic flake8 codes.
See https://docs.astral.sh/ruff/rules

contrib/testgen/base58.py
20 ↗(On Diff #56517)

i don't think we plan to support python 2 again in the future. This removes the need to fix an error.

PiRK published this revision for review.Fri, Nov 7, 16:01
Fabien requested changes to this revision.Mon, Nov 10, 09:37
Fabien added a subscriber: Fabien.
Fabien added inline comments.
arcanist/linter/RuffCheckLinter.php
118 ↗(On Diff #56517)

It's a bit confusing that it's the same code as the ruff format linter. Can we suffix it to differentiate ?

contrib/testgen/base58.py
20–26 ↗(On Diff #56517)

Since we don't support python2, it's now native functions

This revision now requires changes to proceed.Mon, Nov 10, 09:37
contrib/testgen/base58.py
20–26 ↗(On Diff #56517)

I just deleted that entire module in D18914. The fix was a bit too involved, as this codebase was hacking python 3 builtin functions to treat python 3 bytes as python 2 strings.

This revision is now accepted and ready to land.Mon, Nov 10, 12:51
This revision was automatically updated to reflect the committed changes.