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

Format StmtExpr #4788

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Format StmtExpr #4788

merged 1 commit into from
Jun 2, 2023

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jun 1, 2023

Summary

This PR implements formating of StmtExpr and Expr. The main goal is to unlock Expr formatting, not to format ExprStmt 100% correctly.

Test Plan

I reviewed the updated snapshots.

@MichaReiser
Copy link
Member Author

MichaReiser commented Jun 1, 2023

@MichaReiser MichaReiser added the formatter Related to the formatter label Jun 1, 2023
@MichaReiser MichaReiser force-pushed the format-comment-content branch from 87b7f8d to 04a8f7a Compare June 1, 2023 15:48
@MichaReiser MichaReiser force-pushed the format-expr branch 2 times, most recently from 47d28d0 to bc801f0 Compare June 1, 2023 15:59
@@ -450,8 +450,9 @@ last_call()
+{'2.7': dead, '3.7': long_live or die_hard}
+{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
(SomeName)
-(SomeName)
Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we don't do parentheses correctly yet. I'll leave this for another day

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     13.9±0.03ms     2.9 MB/sec    1.01     14.0±0.10ms     2.9 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.4±0.01ms     4.9 MB/sec    1.00      3.4±0.00ms     4.9 MB/sec
linter/all-rules/numpy/globals.py          1.00    420.8±0.51µs     7.0 MB/sec    1.00    419.1±2.17µs     7.0 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.8±0.01ms     4.4 MB/sec    1.00      5.8±0.01ms     4.4 MB/sec
linter/default-rules/large/dataset.py      1.00      6.8±0.01ms     6.0 MB/sec    1.00      6.8±0.03ms     6.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1503.1±2.61µs    11.1 MB/sec    1.00   1504.0±2.24µs    11.1 MB/sec
linter/default-rules/numpy/globals.py      1.00    170.4±0.26µs    17.3 MB/sec    1.01    171.4±0.25µs    17.2 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.1±0.01ms     8.2 MB/sec    1.00      3.1±0.01ms     8.3 MB/sec
parser/large/dataset.py                    1.00      5.2±0.00ms     7.8 MB/sec    1.00      5.2±0.00ms     7.8 MB/sec
parser/numpy/ctypeslib.py                  1.00   1020.9±0.49µs    16.3 MB/sec    1.00   1018.3±0.82µs    16.4 MB/sec
parser/numpy/globals.py                    1.00    105.4±0.17µs    28.0 MB/sec    1.00    105.1±0.16µs    28.1 MB/sec
parser/pydantic/types.py                   1.00      2.2±0.00ms    11.4 MB/sec    1.00      2.2±0.01ms    11.4 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     22.5±0.85ms  1850.7 KB/sec    1.02     22.9±0.75ms  1821.6 KB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      5.8±0.22ms     2.9 MB/sec    1.03      5.9±0.34ms     2.8 MB/sec
linter/all-rules/numpy/globals.py          1.01   659.6±33.15µs     4.5 MB/sec    1.00   654.6±33.98µs     4.5 MB/sec
linter/all-rules/pydantic/types.py         1.00      9.6±0.42ms     2.7 MB/sec    1.05     10.1±0.41ms     2.5 MB/sec
linter/default-rules/large/dataset.py      1.00     11.5±0.36ms     3.5 MB/sec    1.00     11.5±0.48ms     3.5 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01      2.4±0.07ms     7.0 MB/sec    1.00      2.4±0.07ms     7.1 MB/sec
linter/default-rules/numpy/globals.py      1.00   282.2±33.08µs    10.5 MB/sec    1.04   293.9±23.73µs    10.0 MB/sec
linter/default-rules/pydantic/types.py     1.01      5.1±0.20ms     5.0 MB/sec    1.00      5.0±0.18ms     5.1 MB/sec
parser/large/dataset.py                    1.02      8.8±0.32ms     4.6 MB/sec    1.00      8.6±0.21ms     4.7 MB/sec
parser/numpy/ctypeslib.py                  1.01  1598.6±70.88µs    10.4 MB/sec    1.00  1576.4±47.84µs    10.6 MB/sec
parser/numpy/globals.py                    1.00    165.9±6.89µs    17.8 MB/sec    1.01    167.8±6.81µs    17.6 MB/sec
parser/pydantic/types.py                   1.00      3.7±0.13ms     7.0 MB/sec    1.01      3.7±0.10ms     6.9 MB/sec

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Jun 1, 2023
@MichaReiser MichaReiser mentioned this pull request Jun 2, 2023
72 tasks
@MichaReiser MichaReiser force-pushed the format-comment-content branch from 04a8f7a to f3dfee7 Compare June 2, 2023 07:30
@MichaReiser MichaReiser force-pushed the format-comment-content branch from 584a6d7 to 438bc74 Compare June 2, 2023 11:00
Base automatically changed from format-comment-content to main June 2, 2023 11:22
@MichaReiser MichaReiser enabled auto-merge (squash) June 2, 2023 12:43
konstin pushed a commit that referenced this pull request Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants