Skip to content

Comments

Replace flake8 with ruff check "F", "E" and "W" rules#3457

Merged
snowman2 merged 3 commits intorasterio:mainfrom
mwtoews:rm-flake8
Dec 9, 2025
Merged

Replace flake8 with ruff check "F", "E" and "W" rules#3457
snowman2 merged 3 commits intorasterio:mainfrom
mwtoews:rm-flake8

Conversation

@mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Dec 8, 2025

This PR replaces flake8 with ruff check as the code linter.

The applied rules with code adjustments are:

Before the changes, here were the statistics:

$ uvx ruff check --select=E,W,F --statistics
302     E501    [ ] line-too-long
 40	F841	[-] unused-variable
 24	F401	[-] unused-import
 13	W291	[-] trailing-whitespace
 13	W293	[-] blank-line-with-whitespace
  9	F811	[-] redefined-while-unused
  6	E402	[ ] module-import-not-at-top-of-file
  5	E721	[ ] type-comparison
  4	E712	[ ] true-false-comparison
  4	E741	[ ] ambiguous-variable-name
  3	W292	[*] missing-newline-at-end-of-file
  2	E701	[ ] multiple-statements-on-one-line-colon
  2	E713	[*] not-in-test
  2	E722	[ ] bare-except
  2	F541	[*] f-string-missing-placeholders
  1	W605	[*] invalid-escape-sequence
Found 432 errors.
[*] 37 fixable with the `--fix` option (46 hidden fixes can be enabled with the `--unsafe-fixes` option).

Many of the code adjustments were manual, with a few tests that were shadowed with multiple defs (redefined-while-unused (F811)).

Copy link
Member

@sgillies sgillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me with one exception.

@snowman2 snowman2 merged commit 46e3da7 into rasterio:main Dec 9, 2025
4 of 24 checks passed
@snowman2
Copy link
Member

snowman2 commented Dec 9, 2025

Thanks @mwtoews 👍

@snowman2 snowman2 added this to the 1.5.0 milestone Dec 9, 2025
@mwtoews mwtoews deleted the rm-flake8 branch December 9, 2025 15:47
This was referenced Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants