Skip to content

Use a unified policy abstraction for the flake8-tidy-imports rules#6527

Merged
charliermarsh merged 1 commit intomainfrom
charlie/tidy
Aug 12, 2023
Merged

Use a unified policy abstraction for the flake8-tidy-imports rules#6527
charliermarsh merged 1 commit intomainfrom
charlie/tidy

Conversation

@charliermarsh
Copy link
Member

Summary

Generalizes the abstractions for name matching introduced in #6378 and applies them to the existing banned_api rule, such that both rules have a uniform API and implementation.

Test Plan

cargo test

@charliermarsh charliermarsh added the internal An internal refactor or improvement label Aug 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 12, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00     10.7±0.31ms     3.8 MB/sec    1.02     10.9±0.31ms     3.7 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.1±0.07ms     8.0 MB/sec    1.02      2.1±0.12ms     7.8 MB/sec
formatter/numpy/globals.py                 1.02   243.9±12.20µs    12.1 MB/sec    1.00   238.4±13.97µs    12.4 MB/sec
formatter/pydantic/types.py                1.03      4.6±0.19ms     5.6 MB/sec    1.00      4.4±0.17ms     5.7 MB/sec
linter/all-rules/large/dataset.py          1.01     14.7±0.44ms     2.8 MB/sec    1.00     14.6±0.43ms     2.8 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.7±0.09ms     4.5 MB/sec    1.01      3.7±0.09ms     4.5 MB/sec
linter/all-rules/numpy/globals.py          1.02   547.2±47.81µs     5.4 MB/sec    1.00   536.1±18.77µs     5.5 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.4±0.29ms     3.4 MB/sec    1.00      7.4±0.23ms     3.4 MB/sec
linter/default-rules/large/dataset.py      1.00      7.4±0.23ms     5.5 MB/sec    1.00      7.4±0.24ms     5.5 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1624.2±91.64µs    10.3 MB/sec    1.00  1630.1±75.38µs    10.2 MB/sec
linter/default-rules/numpy/globals.py      1.01    199.7±9.62µs    14.8 MB/sec    1.00    197.0±9.10µs    15.0 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.3±0.10ms     7.7 MB/sec    1.00      3.3±0.10ms     7.7 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      9.9±0.03ms     4.1 MB/sec    1.00      9.9±0.05ms     4.1 MB/sec
formatter/numpy/ctypeslib.py               1.00  1890.8±11.90µs     8.8 MB/sec    1.00   1897.3±7.84µs     8.8 MB/sec
formatter/numpy/globals.py                 1.00    195.1±3.92µs    15.1 MB/sec    1.01    196.7±5.24µs    15.0 MB/sec
formatter/pydantic/types.py                1.00      4.2±0.02ms     6.1 MB/sec    1.00      4.2±0.03ms     6.1 MB/sec
linter/all-rules/large/dataset.py          1.01     12.6±0.04ms     3.2 MB/sec    1.00     12.5±0.03ms     3.3 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.5±0.01ms     4.7 MB/sec    1.00      3.5±0.01ms     4.7 MB/sec
linter/all-rules/numpy/globals.py          1.01    372.7±5.04µs     7.9 MB/sec    1.00    370.0±5.23µs     8.0 MB/sec
linter/all-rules/pydantic/types.py         1.01      6.5±0.02ms     3.9 MB/sec    1.00      6.5±0.02ms     3.9 MB/sec
linter/default-rules/large/dataset.py      1.00      6.8±0.04ms     6.0 MB/sec    1.00      6.8±0.02ms     6.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01   1435.0±7.03µs    11.6 MB/sec    1.00   1426.0±6.14µs    11.7 MB/sec
linter/default-rules/numpy/globals.py      1.01    149.8±0.82µs    19.7 MB/sec    1.00    148.5±1.29µs    19.9 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.1±0.01ms     8.3 MB/sec    1.00      3.1±0.02ms     8.3 MB/sec

@charliermarsh charliermarsh merged commit 010293d into main Aug 12, 2023
@charliermarsh charliermarsh deleted the charlie/tidy branch August 12, 2023 20:32
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.

1 participant