Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 1, 2025

Update Ruff to 0.8.6 (originally 0.8.4 but they added a few new releases, why not use them). Add some new linting groups:

  • TRY
  • PLC
  • PLE
  • SLOT

Update rule ignores

  • ANN101 and ANN102 are no longer supported, so they are no longer ignored
  • Ignore PLC0206
  • Ignore D103 in tests

See some draft PRs for examples of what changes:

@github-actions github-actions bot added the priority:low Low priority label Jan 1, 2025
korikuzma
korikuzma previously approved these changes Jan 1, 2025
@jsstevenson
Copy link
Member

potential new rules to ignore:

  • PLC0206 requires explicit use of for key in dict.keys() when iterating through dict keys, rather than for key in dict. It says it's clearer, which is true, but it's also more verbose

@jsstevenson
Copy link
Member

PLC0206 requires explicit use of for key in dict.keys() when iterating through dict keys, rather than for key in dict. It says it's clearer, which is true, but it's also more verbose

Discussion on slack concluded that we should not ignore this, but should ignore SIM118, i.e. so that preferred behavior here would be to require use of .keys(), .values(), or .items() rather than using the implicit __iter__() dunder in a case like for key in my_dict

@jsstevenson
Copy link
Member

Discussion on slack concluded that we should not ignore this, but should ignore SIM118, i.e. so that preferred behavior here would be to require use of .keys(), .values(), or .items() rather than using the implicit iter() dunder in a case like for key in my_dict

FURTHER slack discussion has determined that some of the PLC0206 behavior is less desired so we'll keep SIM118 and ignore PLC0206.

jsstevenson
jsstevenson previously approved these changes Jan 4, 2025
@jsstevenson jsstevenson added priority:medium Medium priority and removed priority:low Low priority labels Jan 4, 2025
@jsstevenson jsstevenson changed the title style(python): update ruff to 0.8.4 style(python): update ruff to 0.8.6 Jan 4, 2025
Copy link
Member

Choose a reason for hiding this comment

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

In squashed commit, I think it'd be helpful to add that new rules are also being added and ignored

@jsstevenson jsstevenson merged commit 2e6bdf6 into main Jan 6, 2025
3 checks passed
@jsstevenson jsstevenson deleted the update-ruff-0.8.4 branch January 6, 2025 15:03
jsstevenson added a commit to cancervariants/gene-normalization that referenced this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants