aspect-build / rules_lint

Run static analysis tools with Bazel
Apache License 2.0
75 stars 42 forks source link

[FR]: Formatting jupyter notebooks #323

Open T-Wainwright opened 2 months ago

T-Wainwright commented 2 months ago

What is the current behavior?

At the moment these are not formatted at all. These could be formatted by a number of formatters, but handling the formatting at multiple levels will require some thought. Formatters such as ruff will only examine the python within the cells, but also the formatting of the raw json should be considered once the cell formatting has been checked.

Describe the feature

Allow parsing of jupyter notebooks to multiple formatters, which autodetect the language within the cells, then a final pass by prettier/ other json formatter with an override to format *.ipynb patterns as json.

alexeagle commented 1 month ago

Hmm, these multi-language formats probably need some dedicated tool outside of Bazel. Everyone wants a formatter like you're describing right? It's similar to the .vue files we already format here which are a mix of three language syntaxes.

We can add to rules_lint when such a formatter exists for wider use :)