Skip to content

all: Fix ruff rules C4, PERF401, and PLC0206. #16776

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Feb 18, 2025

Summary

% ruff check --select=C4,PERF401,PLC0206 --statistics

10	PERF401	[ ] manual-list-comprehension
 3	PLC0206	[ ] dict-index-missing-items
 2	C405   	[*] unnecessary-literal-set
 2	C417   	[*] unnecessary-map
 1	C401   	[*] unnecessary-generator-set
 1	C408   	[*] unnecessary-collection-call
[*] fixable with `ruff check --fix`

Each issue flags a minor inefficiency such as not using comprehensions or repeatedly calling list.append() instead of making a single call to .list.extend().

Testing

Run ruff locally and in pre-commit.

Related to:

Signed-off-by: Christian Clauss <cclauss@me.com>
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.53%. Comparing base (8987b39) to head (89cb90a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #16776   +/-   ##
=======================================
  Coverage   98.53%   98.53%           
=======================================
  Files         169      169           
  Lines       21822    21822           
=======================================
  Hits        21502    21502           
  Misses        320      320           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge
Copy link
Member

Is it possible to enable these checks on CI, so there's no regression?

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.

2 participants