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

docs: all flake8-comprehension rules #3631

Merged
merged 4 commits into from
Mar 21, 2023

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Mar 20, 2023

Created an initial draft for this, will go over them once more and make it ready to review.

#2646

@@ -31,6 +31,7 @@ use super::helpers;
///
/// This rule applies to a variety of functions, including `list`, `reversed`,
/// `set`, `sorted`, and `tuple`. For example:
///
Copy link
Member Author

Choose a reason for hiding this comment

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

This is done to avoid grouping all the list elements into a single line: https://beta.ruff.rs/docs/rules/unnecessary-double-cast-or-process/

I generated the docs locally and confirmed that the elements are now rendered as required.

@@ -32,6 +32,7 @@ use super::helpers;
///
/// This rule also applies to `map` calls within `list`, `set`, and `dict`
/// calls. For example:
///
Copy link
Member Author

Choose a reason for hiding this comment

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

@dhruvmanila dhruvmanila changed the title docs: all flake8-comprehension rules docs: all flake8-comprehension rules Mar 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.02     14.2±0.02ms     2.9 MB/sec    1.00     14.0±0.03ms     2.9 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.8±0.01ms     4.4 MB/sec    1.00      3.7±0.00ms     4.5 MB/sec
linter/all-rules/numpy/globals.py          1.00    435.9±1.85µs     6.8 MB/sec    1.00    435.6±2.43µs     6.8 MB/sec
linter/all-rules/pydantic/types.py         1.01      6.3±0.01ms     4.0 MB/sec    1.00      6.2±0.01ms     4.1 MB/sec
linter/default-rules/large/dataset.py      1.03      8.0±0.01ms     5.1 MB/sec    1.00      7.8±0.03ms     5.2 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.02   1730.2±6.18µs     9.6 MB/sec    1.00   1704.3±3.34µs     9.8 MB/sec
linter/default-rules/numpy/globals.py      1.00    179.2±0.42µs    16.5 MB/sec    1.00    178.5±1.12µs    16.5 MB/sec
linter/default-rules/pydantic/types.py     1.02      3.7±0.02ms     6.9 MB/sec    1.00      3.6±0.00ms     7.0 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     21.4±0.80ms  1944.2 KB/sec    1.03     22.1±0.99ms  1887.1 KB/sec
linter/all-rules/numpy/ctypeslib.py        1.04      6.0±0.24ms     2.8 MB/sec    1.00      5.8±0.43ms     2.9 MB/sec
linter/all-rules/numpy/globals.py          1.05   726.6±28.82µs     4.1 MB/sec    1.00   695.1±26.76µs     4.2 MB/sec
linter/all-rules/pydantic/types.py         1.07      9.8±0.29ms     2.6 MB/sec    1.00      9.2±0.43ms     2.8 MB/sec
linter/default-rules/large/dataset.py      1.04     12.4±0.37ms     3.3 MB/sec    1.00     11.9±0.30ms     3.4 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.02      2.6±0.09ms     6.4 MB/sec    1.00      2.5±0.08ms     6.6 MB/sec
linter/default-rules/numpy/globals.py      1.05   301.7±12.69µs     9.8 MB/sec    1.00   286.5±15.16µs    10.3 MB/sec
linter/default-rules/pydantic/types.py     1.03      5.7±0.27ms     4.5 MB/sec    1.00      5.5±0.17ms     4.6 MB/sec

@charliermarsh
Copy link
Member

Awesome, thanks for taking this on. Just request a review from me whenever it's ready :)

@dhruvmanila dhruvmanila marked this pull request as ready for review March 21, 2023 04:11
@dhruvmanila
Copy link
Member Author

@charliermarsh Review request

@charliermarsh charliermarsh enabled auto-merge (squash) March 21, 2023 14:22
@charliermarsh charliermarsh merged commit 33394e4 into astral-sh:main Mar 21, 2023
@dhruvmanila dhruvmanila deleted the docs/flake8-comprehension branch March 22, 2023 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants