Skip to content

Fix formatter generate.py#5829

Merged
MichaReiser merged 1 commit intomainfrom
fix-formatter-generate-script
Jul 17, 2023
Merged

Fix formatter generate.py#5829
MichaReiser merged 1 commit intomainfrom
fix-formatter-generate-script

Conversation

@MichaReiser
Copy link
Member

Summary

#5670 broke the formatter's generate script because it removes the ::default() call for all FormatNodeRule implementations. This is fine for unit struct, but not all format rules are unit structs.

This PR reverts the changes of #5670 and instead allows the default_constructed_unit_structs clippy rule for the generated code.

Test Plan

cargo clippy no longer complains on nighly

@MichaReiser MichaReiser marked this pull request as ready for review July 17, 2023 10:06
@MichaReiser
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@MichaReiser MichaReiser enabled auto-merge (squash) July 17, 2023 10:06
@MichaReiser MichaReiser force-pushed the fix-formatter-generate-script branch 2 times, most recently from 90b640e to 1749581 Compare July 17, 2023 10:27
@MichaReiser MichaReiser force-pushed the fix-formatter-generate-script branch from 1749581 to 344698f Compare July 17, 2023 10:32
auto-merge was automatically disabled July 17, 2023 10:34

Pull request was closed

@MichaReiser MichaReiser reopened this Jul 17, 2023
@MichaReiser MichaReiser enabled auto-merge (squash) July 17, 2023 10:34
@MichaReiser MichaReiser merged commit 2106354 into main Jul 17, 2023
@MichaReiser MichaReiser deleted the fix-formatter-generate-script branch July 17, 2023 10:41
@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.02      9.5±0.02ms     4.3 MB/sec    1.00      9.3±0.02ms     4.4 MB/sec
formatter/numpy/ctypeslib.py               1.01   1877.8±2.96µs     8.9 MB/sec    1.00   1857.5±2.63µs     9.0 MB/sec
formatter/numpy/globals.py                 1.01    211.0±0.42µs    14.0 MB/sec    1.00    209.2±0.41µs    14.1 MB/sec
formatter/pydantic/types.py                1.02      4.1±0.01ms     6.2 MB/sec    1.00      4.0±0.00ms     6.4 MB/sec
linter/all-rules/large/dataset.py          1.00     13.1±0.02ms     3.1 MB/sec    1.00     13.1±0.03ms     3.1 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.3±0.00ms     5.0 MB/sec    1.00      3.3±0.00ms     5.0 MB/sec
linter/all-rules/numpy/globals.py          1.01    442.7±3.39µs     6.7 MB/sec    1.00    438.6±0.39µs     6.7 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.9±0.02ms     4.3 MB/sec    1.00      5.9±0.01ms     4.3 MB/sec
linter/default-rules/large/dataset.py      1.02      6.6±0.01ms     6.2 MB/sec    1.00      6.5±0.02ms     6.3 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01   1410.3±1.49µs    11.8 MB/sec    1.00   1389.7±2.12µs    12.0 MB/sec
linter/default-rules/numpy/globals.py      1.00    156.0±0.27µs    18.9 MB/sec    1.01    157.4±3.22µs    18.7 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.0±0.01ms     8.6 MB/sec    1.00      2.9±0.01ms     8.7 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.02     13.9±0.44ms     2.9 MB/sec    1.00     13.7±0.69ms     3.0 MB/sec
formatter/numpy/ctypeslib.py               1.08      2.8±0.11ms     5.9 MB/sec    1.00      2.6±0.11ms     6.4 MB/sec
formatter/numpy/globals.py                 1.00   313.3±18.13µs     9.4 MB/sec    1.03   324.2±63.75µs     9.1 MB/sec
formatter/pydantic/types.py                1.01      5.9±0.23ms     4.4 MB/sec    1.00      5.8±0.19ms     4.4 MB/sec
linter/all-rules/large/dataset.py          1.00     18.4±0.48ms     2.2 MB/sec    1.05     19.3±0.46ms     2.1 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.9±0.15ms     3.4 MB/sec    1.04      5.1±0.16ms     3.2 MB/sec
linter/all-rules/numpy/globals.py          1.00   621.2±27.75µs     4.8 MB/sec    1.00   619.9±21.73µs     4.8 MB/sec
linter/all-rules/pydantic/types.py         1.00      8.6±0.27ms     3.0 MB/sec    1.04      8.9±0.27ms     2.9 MB/sec
linter/default-rules/large/dataset.py      1.01     10.0±0.49ms     4.1 MB/sec    1.00      9.9±0.30ms     4.1 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00      2.0±0.06ms     8.2 MB/sec    1.01      2.1±0.08ms     8.0 MB/sec
linter/default-rules/numpy/globals.py      1.02   256.6±23.72µs    11.5 MB/sec    1.00   252.3±13.74µs    11.7 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.5±0.17ms     5.7 MB/sec    1.00      4.5±0.18ms     5.7 MB/sec

evanrittenhouse pushed a commit to evanrittenhouse/ruff that referenced this pull request Jul 19, 2023
konstin pushed a commit that referenced this pull request Jul 19, 2023
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.

1 participant