Skip to content
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

Recategorize static-key-dict-comprehension from RUF011 to B035 #9428

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

charliermarsh
Copy link
Member

Summary

This rule was added to flake8-bugbear. In general, we tend to prefer redirecting to prominent plugins when our own rules are reimplemented (since more projects have B activated than RUF).

Test Plan

cargo test

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Jan 8, 2024
@charliermarsh charliermarsh changed the title Redirect RUF011 to B035 Recategorize static-key-dict-comprehension from RUF011 to B035 Jan 8, 2024
@MichaReiser
Copy link
Member

MichaReiser commented Jan 8, 2024

A few questions here to understand if this is safe to land under our versioning policy or if we need to delay it to the next major minor release:

  • Does this now enable the rule when a user enables the B rule group (enabling more rules)
  • Is the rule enabled when users use the RUFF selector?
  • Do noqa: RUF011 continue to work?

This is more of a question for our versioning policy: If I remember correctly, this changes the rule codes in diagnostics. We may need to consider this a breaking change because GitLab and other tools that track diagnostics over time now consider the RUF011 diagnostics as fixed but reports new B035 diagnostics.

@charliermarsh
Copy link
Member Author

Yeah, we may need to ship this as part of 0.2.0. Looking for input. To answer your questions:

  • Yes.
  • No. (It does if they select RUF011.)
  • Yes.

@charliermarsh charliermarsh force-pushed the charlie/B035 branch 3 times, most recently from 1867b11 to 9558c11 Compare January 11, 2024 02:36
Copy link
Contributor

github-actions bot commented Jan 11, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+1 -0 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

RasaHQ/rasa (+1 -0 violations, +0 -0 fixes)

+ tests/graph_components/validators/test_default_recipe_validator.py:815:64: RUF100 [*] Unused `noqa` directive (non-enabled: `B035`)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF100 1 1 0 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1 -0 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

RasaHQ/rasa (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ tests/graph_components/validators/test_default_recipe_validator.py:815:64: RUF100 [*] Unused `noqa` directive (non-enabled: `B035`)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF100 1 1 0 0 0

@charliermarsh charliermarsh mentioned this pull request Jan 11, 2024
13 tasks
@MichaReiser MichaReiser added this to the v0.2.0 milestone Jan 19, 2024
@charliermarsh charliermarsh changed the base branch from main to release/0.2.0 January 29, 2024 17:57
@charliermarsh charliermarsh merged commit 50fffcf into release/0.2.0 Jan 29, 2024
@charliermarsh charliermarsh deleted the charlie/B035 branch January 29, 2024 18:00
@zanieb zanieb mentioned this pull request Jan 29, 2024
zanieb pushed a commit that referenced this pull request Jan 29, 2024
…9428)

## Summary

This rule was added to flake8-bugbear. In general, we tend to prefer
redirecting to prominent plugins when our own rules are reimplemented
(since more projects have `B` activated than `RUF`).

## Test Plan

`cargo test`
zanieb pushed a commit that referenced this pull request Jan 30, 2024
…9428)

## Summary

This rule was added to flake8-bugbear. In general, we tend to prefer
redirecting to prominent plugins when our own rules are reimplemented
(since more projects have `B` activated than `RUF`).

## Test Plan

`cargo test`
zanieb added a commit that referenced this pull request Feb 1, 2024
…9428)

## Summary

This rule was added to flake8-bugbear. In general, we tend to prefer
redirecting to prominent plugins when our own rules are reimplemented
(since more projects have `B` activated than `RUF`).

## Test Plan

`cargo test`
# Conflicts:
#	crates/ruff_linter/src/rules/ruff/rules/mod.rs
zanieb added a commit that referenced this pull request Feb 1, 2024
For consistency with other redirected rules as in
#9755

Follow-up to #9428
zanieb added a commit that referenced this pull request Feb 1, 2024
…9428)

## Summary

This rule was added to flake8-bugbear. In general, we tend to prefer
redirecting to prominent plugins when our own rules are reimplemented
(since more projects have `B` activated than `RUF`).

## Test Plan

`cargo test`
# Conflicts:
#	crates/ruff_linter/src/rules/ruff/rules/mod.rs
zanieb added a commit that referenced this pull request Feb 1, 2024
For consistency with other redirected rules as in
#9755

Follow-up to #9428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants