adamchainz / flake8-comprehensions

❄️ A flake8 plugin to help you write better list/set/dict comprehensions.
MIT License
464 stars 23 forks source link

Add rule for dict comprehensions with constant values #553

Closed tjkuson closed 3 months ago

tjkuson commented 8 months ago

Adds C420 that checks for dictionary comprehensions that use constant values.

Changed the fixture for test_C418_pass as it was failing (dict({x: 1 for x in range(1)}, a=1) triggers the new rule).

Closes #552.

adamchainz commented 3 months ago

Thank you!