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

Add message to formatter SyntaxError #5881

Merged
merged 2 commits into from
Jul 19, 2023
Merged

Conversation

konstin
Copy link
Member

@konstin konstin commented Jul 19, 2023

Summary Add a static string error message to the formatter syntax error so we can disambiguate where the syntax error came from

Test Plan No fixed tests, we don't expect this to occur, but it helped with transformers syntax error debugging:

Error: Failed to format node

Caused by:
    syntax error: slice first colon token was not a colon

**Summary** Add a static string error message to the formatter syntax error so we can disambiguate where the syntax error came from

**Test Plan** No fixed tests, we don't expect this to occur, but it helped with transformers syntax error debugging:

```
Error: Failed to format node

Caused by:
    syntax error: slice first colon token was not a colon
```
@konstin
Copy link
Member Author

konstin commented Jul 19, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 19, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      9.8±0.03ms     4.1 MB/sec    1.01      9.9±0.03ms     4.1 MB/sec
formatter/numpy/ctypeslib.py               1.00   1914.3±2.99µs     8.7 MB/sec    1.01   1924.0±4.60µs     8.7 MB/sec
formatter/numpy/globals.py                 1.00    208.7±0.21µs    14.1 MB/sec    1.00    209.7±0.76µs    14.1 MB/sec
formatter/pydantic/types.py                1.00      4.2±0.01ms     6.0 MB/sec    1.01      4.3±0.01ms     6.0 MB/sec
linter/all-rules/large/dataset.py          1.00     13.5±0.02ms     3.0 MB/sec    1.01     13.6±0.04ms     3.0 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.4±0.01ms     4.9 MB/sec    1.00      3.4±0.01ms     4.8 MB/sec
linter/all-rules/numpy/globals.py          1.00    373.5±0.82µs     7.9 MB/sec    1.00    374.8±2.62µs     7.9 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.1±0.01ms     4.2 MB/sec    1.00      6.1±0.01ms     4.2 MB/sec
linter/default-rules/large/dataset.py      1.00      7.1±0.01ms     5.8 MB/sec    1.01      7.1±0.01ms     5.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1437.0±2.54µs    11.6 MB/sec    1.01   1446.0±5.55µs    11.5 MB/sec
linter/default-rules/numpy/globals.py      1.00    149.5±0.57µs    19.7 MB/sec    1.01    150.4±0.21µs    19.6 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.2±0.01ms     8.1 MB/sec    1.01      3.2±0.01ms     8.1 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00     11.7±0.35ms     3.5 MB/sec    1.00     11.7±0.35ms     3.5 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.3±0.11ms     7.1 MB/sec    1.01      2.3±0.12ms     7.1 MB/sec
formatter/numpy/globals.py                 1.00   267.8±20.04µs    11.0 MB/sec    1.00   266.9±15.18µs    11.1 MB/sec
formatter/pydantic/types.py                1.00      5.2±0.26ms     4.9 MB/sec    1.02      5.3±0.31ms     4.8 MB/sec
linter/all-rules/large/dataset.py          1.01     16.5±0.45ms     2.5 MB/sec    1.00     16.4±0.39ms     2.5 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.4±0.19ms     3.8 MB/sec    1.02      4.5±0.16ms     3.7 MB/sec
linter/all-rules/numpy/globals.py          1.00   523.3±25.42µs     5.6 MB/sec    1.01   527.4±18.20µs     5.6 MB/sec
linter/all-rules/pydantic/types.py         1.01      7.5±0.23ms     3.4 MB/sec    1.00      7.4±0.20ms     3.4 MB/sec
linter/default-rules/large/dataset.py      1.00      8.5±0.21ms     4.8 MB/sec    1.00      8.6±0.25ms     4.8 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1814.3±69.79µs     9.2 MB/sec    1.00  1812.7±62.65µs     9.2 MB/sec
linter/default-rules/numpy/globals.py      1.01   207.2±15.54µs    14.2 MB/sec    1.00    205.1±9.04µs    14.4 MB/sec
linter/default-rules/pydantic/types.py     1.04      4.0±0.15ms     6.5 MB/sec    1.00      3.8±0.11ms     6.7 MB/sec

@konstin konstin merged commit 63ed7a3 into main Jul 19, 2023
@konstin konstin deleted the add_message_to_syntax_error branch July 19, 2023 15:15
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