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 UnaryExpr #5207

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Format UnaryExpr #5207

merged 1 commit into from
Jun 21, 2023

Conversation

MichaReiser
Copy link
Member

Summary

This PR adds basic formatting for unary expressions.

Test Plan

I added a new unary.py with custom test cases

@MichaReiser
Copy link
Member Author

MichaReiser commented Jun 20, 2023

+NOT_IMPLEMENTED_bool_op1 and NOT_IMPLEMENTED_bool_op2
+NOT_IMPLEMENTED_bool_op1 and NOT_IMPLEMENTED_bool_op2
+NOT_YET_IMPLEMENTED_ExprUnaryOp
++really ** -confusing ** ~operator**-precedence
Copy link
Member Author

@MichaReiser MichaReiser Jun 20, 2023

Choose a reason for hiding this comment

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

This looks incorrect but is unrelated to unary. I'll take a look separately from this PR

@MichaReiser MichaReiser linked an issue Jun 20, 2023 that may be closed by this pull request
@MichaReiser MichaReiser added the formatter Related to the formatter label Jun 20, 2023
@MichaReiser MichaReiser requested a review from konstin June 20, 2023 16:06
@MichaReiser MichaReiser force-pushed the more-bin-op-formatting branch from 5c30e73 to 516784c Compare June 20, 2023 16:34
trailing_comments(trailing_operator_comments).fmt(f)?;
}

if op.is_not() {}
Copy link
Member

Choose a reason for hiding this comment

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

huh?

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops. I'm surprised that clippy isn't complaining about this.

@MichaReiser MichaReiser force-pushed the more-bin-op-formatting branch from 516784c to c99b89b Compare June 21, 2023 07:21
Base automatically changed from more-bin-op-formatting to main June 21, 2023 07:40
@MichaReiser
Copy link
Member Author

Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 21, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      6.9±0.02ms     5.9 MB/sec    1.00      6.9±0.03ms     5.9 MB/sec
formatter/numpy/ctypeslib.py               1.01  1390.4±33.46µs    12.0 MB/sec    1.00  1382.0±24.92µs    12.0 MB/sec
formatter/numpy/globals.py                 1.00    133.3±0.22µs    22.1 MB/sec    1.00    133.7±0.59µs    22.1 MB/sec
formatter/pydantic/types.py                1.00      2.8±0.01ms     9.2 MB/sec    1.00      2.8±0.01ms     9.2 MB/sec
linter/all-rules/large/dataset.py          1.03     14.2±0.08ms     2.9 MB/sec    1.00     13.8±0.07ms     2.9 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.03      3.6±0.03ms     4.7 MB/sec    1.00      3.5±0.00ms     4.8 MB/sec
linter/all-rules/numpy/globals.py          1.00    367.5±1.26µs     8.0 MB/sec    1.02   373.1±11.22µs     7.9 MB/sec
linter/all-rules/pydantic/types.py         1.01      6.2±0.05ms     4.1 MB/sec    1.00      6.1±0.05ms     4.2 MB/sec
linter/default-rules/large/dataset.py      1.06      7.5±0.04ms     5.4 MB/sec    1.00      7.1±0.04ms     5.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.04   1534.4±2.77µs    10.9 MB/sec    1.00   1471.6±2.12µs    11.3 MB/sec
linter/default-rules/numpy/globals.py      1.03    161.3±0.46µs    18.3 MB/sec    1.00    156.5±0.20µs    18.9 MB/sec
linter/default-rules/pydantic/types.py     1.04      3.3±0.01ms     7.7 MB/sec    1.00      3.2±0.01ms     8.0 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      7.7±0.15ms     5.3 MB/sec    1.00      7.7±0.08ms     5.3 MB/sec
formatter/numpy/ctypeslib.py               1.00  1574.7±18.18µs    10.6 MB/sec    1.00  1575.8±17.19µs    10.6 MB/sec
formatter/numpy/globals.py                 1.00    154.9±3.90µs    19.1 MB/sec    1.01    156.8±8.55µs    18.8 MB/sec
formatter/pydantic/types.py                1.00      3.1±0.05ms     8.1 MB/sec    1.00      3.1±0.04ms     8.1 MB/sec
linter/all-rules/large/dataset.py          1.00     15.3±0.20ms     2.7 MB/sec    1.01     15.5±0.33ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.0±0.07ms     4.1 MB/sec    1.00      4.0±0.06ms     4.1 MB/sec
linter/all-rules/numpy/globals.py          1.01    491.8±6.71µs     6.0 MB/sec    1.00    488.5±7.16µs     6.0 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.8±0.09ms     3.8 MB/sec    1.00      6.8±0.13ms     3.7 MB/sec
linter/default-rules/large/dataset.py      1.00      7.9±0.07ms     5.2 MB/sec    1.00      7.9±0.07ms     5.2 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1683.6±19.19µs     9.9 MB/sec    1.00  1679.3±35.39µs     9.9 MB/sec
linter/default-rules/numpy/globals.py      1.01    193.6±3.84µs    15.2 MB/sec    1.00    192.2±4.44µs    15.3 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.6±0.03ms     7.1 MB/sec    1.00      3.5±0.04ms     7.2 MB/sec

@MichaReiser MichaReiser merged commit 1336ca6 into main Jun 21, 2023
@MichaReiser
Copy link
Member Author

@MichaReiser merged this pull request with Graphite.

@MichaReiser MichaReiser deleted the format-unary-expr branch June 21, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatter: UnaryOp
2 participants