nbqa and cspell
See original GitHub issueHi!
I am trying to get nbqa and cspell working together. Got some mild success, but run into two cumbersome situations that I would like to let you know.
This is how I am running it. So far is good, it is great that I have an specific report of which cell is failing, and I could apply different configurations for markdown and for code cells.
# For every notebook in the folder
find . -name '*.ipynb' -exec nbqa --nbqa-shell --nbqa-md cspell {} \;
find . -name '*.ipynb' -exec nbqa --nbqa-shell cspell {} \;
# For a single notebook
nbqa --nbqa-shell --nbqa-md cspell notebook.ipynb
nbqa --nbqa-shell cspell notebook.ipynb
Can’t execute a cspell subcommand
Any hints on how to make the commands below to work?
root@c77040892c65:~/# cspell --help
Usage: cspell [options] [command]
Spelling Checker for Code
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
lint [options] [globs...] Check spelling
trace [options] [words...] Trace words -- Search for words in the configuration and dictionaries.
check [options] <files...> Spell check file(s) and display the result. The full file is displayed in color.
link Link dictionaries and other settings to the cspell global config.
suggestions|sug [options] [words...] Spelling Suggestions for words.
help [command] display help for command
root@c77040892c65:~/# nbqa --nbqa-shell --nbqa-md cspell lint notebook.ipynb
No such file or directory: lint
root@c77040892c65:~/# nbqa --nbqa-shell --nbqa-md cspell check notebook.ipynb
No such file or directory: check
Can’t control the comments that nbqa add as separators
Those separators are autogenerated, and gets flagged by cspell
as unknown words.
Not a big deal, I think I can ignore them with a config file.
The other option I have is to dump the md content into a file, sed away those separators, and cspell the result, but I will loose the cell index error reporting.
Any ideas how to get them skipped?
root@c77040892c65:~/# nbqa --nbqa-shell --nbqa-md cspell notebook.ipynb
notebook.ipynb:cell_1:0:5 - Unknown word (NBQA)
notebook.ipynb:cell_2:0:5 - Unknown word (NBQA)
root@c77040892c65:~/# nbqa --nbqa-shell --nbqa-md cat notebook.ipynb
# %%NBQA-MD-SEP42abbe
<a id="top"></a>
# Notebook Title
# %%NBQA-MD-SEP42abbe
Thank you!
Issue Analytics
- State:
- Created a year ago
- Comments:14 (4 by maintainers)
Top GitHub Comments
Did you want to raise a PR with your commit?
This is my Dockerfile, hope it helps