Skip to content

Comments

Refactor magic trailing comma#5339

Merged
konstin merged 1 commit intomainfrom
refactor_magic_trailing_comma
Jun 23, 2023
Merged

Refactor magic trailing comma#5339
konstin merged 1 commit intomainfrom
refactor_magic_trailing_comma

Conversation

@konstin
Copy link
Member

@konstin konstin commented Jun 23, 2023

Summary

This is small refactoring to reuse the code that detects the magic trailing comma across functions. I make this change now to avoid copying code in a later PR. @MichaReiser is planning on making a larger refactoring later that integrates with the join nodes builder

Test Plan

No functional changes. The magic trailing comma behaviour is checked by the fixtures.

This is a small refactoring to magic trailing comma support to avoid copying code for the call implementation.

No functional changes, fixtures contain magic trailing comma tests.
@konstin
Copy link
Member Author

konstin commented Jun 23, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.02      7.9±0.04ms     5.1 MB/sec    1.00      7.8±0.13ms     5.2 MB/sec
formatter/numpy/ctypeslib.py               1.00  1830.5±22.37µs     9.1 MB/sec    1.00  1839.5±18.71µs     9.1 MB/sec
formatter/numpy/globals.py                 1.04    221.1±3.10µs    13.3 MB/sec    1.00    212.9±8.40µs    13.9 MB/sec
formatter/pydantic/types.py                1.03      4.1±0.05ms     6.2 MB/sec    1.00      4.0±0.07ms     6.4 MB/sec
linter/all-rules/large/dataset.py          1.00     15.2±0.46ms     2.7 MB/sec    1.02     15.6±0.21ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.9±0.06ms     4.3 MB/sec    1.01      3.9±0.03ms     4.2 MB/sec
linter/all-rules/numpy/globals.py          1.00    507.0±7.46µs     5.8 MB/sec    1.00   505.9±10.74µs     5.8 MB/sec
linter/all-rules/pydantic/types.py         1.01      7.0±0.10ms     3.7 MB/sec    1.00      6.9±0.09ms     3.7 MB/sec
linter/default-rules/large/dataset.py      1.02      7.9±0.22ms     5.2 MB/sec    1.00      7.7±0.12ms     5.3 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.02  1723.9±35.03µs     9.7 MB/sec    1.00  1689.7±29.78µs     9.9 MB/sec
linter/default-rules/numpy/globals.py      1.00    193.9±3.98µs    15.2 MB/sec    1.00    193.0±2.37µs    15.3 MB/sec
linter/default-rules/pydantic/types.py     1.03      3.6±0.06ms     7.1 MB/sec    1.00      3.5±0.04ms     7.3 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00     10.6±0.27ms     3.8 MB/sec    1.03     10.9±0.30ms     3.7 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.4±0.07ms     7.0 MB/sec    1.03      2.4±0.10ms     6.9 MB/sec
formatter/numpy/globals.py                 1.01   299.2±26.95µs     9.9 MB/sec    1.00   296.9±14.09µs     9.9 MB/sec
formatter/pydantic/types.py                1.00      5.4±0.17ms     4.7 MB/sec    1.01      5.4±0.21ms     4.7 MB/sec
linter/all-rules/large/dataset.py          1.00     20.9±0.50ms  1989.8 KB/sec    1.03     21.6±0.72ms  1926.8 KB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      5.5±0.20ms     3.0 MB/sec    1.01      5.6±0.20ms     3.0 MB/sec
linter/all-rules/numpy/globals.py          1.00   670.7±31.17µs     4.4 MB/sec    1.01   675.0±30.35µs     4.4 MB/sec
linter/all-rules/pydantic/types.py         1.00      9.3±0.29ms     2.7 MB/sec    1.04      9.7±0.39ms     2.6 MB/sec
linter/default-rules/large/dataset.py      1.00     10.7±0.21ms     3.8 MB/sec    1.03     11.0±0.38ms     3.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01      2.3±0.08ms     7.2 MB/sec    1.00      2.3±0.07ms     7.3 MB/sec
linter/default-rules/numpy/globals.py      1.00   276.3±10.94µs    10.7 MB/sec    1.03   284.6±19.20µs    10.4 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.9±0.14ms     5.2 MB/sec    1.02      5.0±0.21ms     5.1 MB/sec

@konstin konstin merged commit 4b65446 into main Jun 23, 2023
@konstin konstin deleted the refactor_magic_trailing_comma branch June 23, 2023 16:53
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