You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cells with shell commands throw a parse error in build 0.6.4.
To reproduce this issue create a single cell in a notebook with the following contents !ls and run blackbricks on it.
Here's a snippet of the error:
File "/usr/local/opt/pyenv/versions/3.8.12/envs/test/lib/python3.8/site-packages/blackbricks/cli.py", line 184, in main
n_changed_files = process_files(
File "/usr/local/opt/pyenv/versions/3.8.12/envs/test/lib/python3.8/site-packages/blackbricks/cli.py", line 32, in process_files
output = format_str(content, config=format_config)
File "/usr/local/opt/pyenv/versions/3.8.12/envs/test/lib/python3.8/site-packages/blackbricks/blackbricks.py", line 111, in format_str
black.format_str(
File "src/black/__init__.py", line 1131, in format_str
File "src/black/__init__.py", line 1141, in _format_str_once
File "src/black/parsing.py", line 128, in lib2to3_parse
black.parsing.InvalidInput: Cannot parse: 1:0: !ls
The text was updated successfully, but these errors were encountered:
Using these !command style shell commands leaves you with a file that no longer parses as a valid Python file. I'm not particularly keen on trying to special-case this, as detecting and handling this, in general, would be highly non-trivial.
You can just use a %sh-cell instead, that will work, and IMO will be clearer.
Cells with shell commands throw a parse error in build 0.6.4.
To reproduce this issue create a single cell in a notebook with the following contents
!ls
and run blackbricks on it.Here's a snippet of the error:
The text was updated successfully, but these errors were encountered: