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

Add Applicability to Fix #4303

Merged
merged 11 commits into from
May 10, 2023
Merged

Add Applicability to Fix #4303

merged 11 commits into from
May 10, 2023

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented May 9, 2023

Adds Applicability levels to Fix with corresponding factory methods and deprecates the unspecified fix methods.

Updates Diff output to include "Fix", "Suggested fix", and "Possible fix" depending on the applicability.

Closes #4183

@zanieb zanieb force-pushed the internal/4183 branch 2 times, most recently from b51fa31 to f5fc16d Compare May 9, 2023 06:21
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     16.7±0.16ms     2.4 MB/sec    1.00     16.8±0.13ms     2.4 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.0±0.03ms     4.2 MB/sec    1.00      4.0±0.03ms     4.2 MB/sec
linter/all-rules/numpy/globals.py          1.00    490.9±2.78µs     6.0 MB/sec    1.00    491.2±8.12µs     6.0 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.0±0.04ms     3.7 MB/sec    1.00      6.9±0.16ms     3.7 MB/sec
linter/default-rules/large/dataset.py      1.02      8.3±0.06ms     4.9 MB/sec    1.00      8.1±0.05ms     5.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.02   1775.6±9.02µs     9.4 MB/sec    1.00  1740.3±12.96µs     9.6 MB/sec
linter/default-rules/numpy/globals.py      1.02    197.8±2.36µs    14.9 MB/sec    1.00    193.6±4.55µs    15.2 MB/sec
linter/default-rules/pydantic/types.py     1.02      3.7±0.01ms     6.9 MB/sec    1.00      3.6±0.03ms     7.0 MB/sec
parser/large/dataset.py                    1.00      6.6±0.03ms     6.2 MB/sec    1.10      7.3±0.05ms     5.6 MB/sec
parser/numpy/ctypeslib.py                  1.00   1287.3±3.48µs    12.9 MB/sec    1.09   1397.3±6.70µs    11.9 MB/sec
parser/numpy/globals.py                    1.00    130.4±0.40µs    22.6 MB/sec    1.06    138.8±1.41µs    21.3 MB/sec
parser/pydantic/types.py                   1.00      2.8±0.01ms     9.1 MB/sec    1.09      3.1±0.02ms     8.4 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     18.2±0.66ms     2.2 MB/sec    1.01     18.5±0.72ms     2.2 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.8±0.26ms     3.5 MB/sec    1.00      4.7±0.30ms     3.5 MB/sec
linter/all-rules/numpy/globals.py          1.00   544.0±24.42µs     5.4 MB/sec    1.02   552.6±25.87µs     5.3 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.7±0.37ms     3.3 MB/sec    1.00      7.7±0.35ms     3.3 MB/sec
linter/default-rules/large/dataset.py      1.00      9.3±0.51ms     4.4 MB/sec    1.01      9.4±0.33ms     4.3 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1938.4±78.28µs     8.6 MB/sec    1.02  1980.3±79.16µs     8.4 MB/sec
linter/default-rules/numpy/globals.py      1.00   232.7±15.46µs    12.7 MB/sec    1.05   244.3±30.32µs    12.1 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.1±0.26ms     6.2 MB/sec    1.03      4.2±0.24ms     6.0 MB/sec
parser/large/dataset.py                    1.00      7.8±0.32ms     5.2 MB/sec    1.02      8.0±0.28ms     5.1 MB/sec
parser/numpy/ctypeslib.py                  1.00  1500.9±78.75µs    11.1 MB/sec    1.03  1542.4±71.67µs    10.8 MB/sec
parser/numpy/globals.py                    1.00   150.6±10.53µs    19.6 MB/sec    1.04    156.2±9.08µs    18.9 MB/sec
parser/pydantic/types.py                   1.00      3.4±0.22ms     7.5 MB/sec    1.02      3.4±0.14ms     7.4 MB/sec

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thank you so much! I hope adding all the allow(deprecated) wasn't too much pain?

crates/ruff/src/message/diff.rs Show resolved Hide resolved
crates/ruff/src/rules/flake8_pie/rules.rs Outdated Show resolved Hide resolved
crates/ruff/src/rules/pyupgrade/rules/native_literals.rs Outdated Show resolved Hide resolved
crates/ruff_diagnostics/src/fix.rs Outdated Show resolved Hide resolved
crates/ruff_diagnostics/src/fix.rs Outdated Show resolved Hide resolved
@MichaReiser MichaReiser added the internal An internal refactor or improvement label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Applicability to Fix
2 participants