question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi!

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:closed
  • Created a year ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoGorellicommented, Sep 10, 2022

Did you want to raise a PR with your commit?

1reaction
dnolivercommented, Aug 24, 2022

This is my Dockerfile, hope it helps

FROM ubuntu:20.04

RUN apt-get update \
    && apt-get install -y \
        python3 python3-pip

RUN pip install nbqa black isort mdformat pyupgrade pylint

RUN apt-get update \
    && apt-get install -y curl \
    && curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
        nodejs

RUN npm install -g cspell

VOLUME /root

WORKDIR /root

CMD bash
Read more comments on GitHub >

github_iconTop Results From Across the Web

Inside the NBA Spelling Bee | NBA on TNT - YouTube
Chuck trying to spell "spectacular" sparked a whole new segment. The fellas challenged the 2021 Scripps National Spelling Bee Champion, ...
Read more >
Inside the NBA: Shaq dared Barkley to spell 'spectacular' for ...
Shaq said he'd pay Charles Barkley to $10,000 to spell spectacular on 'Inside the NBA' and he almost couldn't do it ...
Read more >
Shaq challenges Charles to spell 'spectacular' - NBA.com
Shaq challenges Charles to spell 'spectacular'
Read more >
NBA Spell Jam - The Pudding
A spelling bee for the hardest names in the NBA.
Read more >
Supported hooks - pre-commit
It should be run after use-tidy-description; spell-check - perform a spell check ... nbqa - Run any standard Python code quality tool on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found