Closed MarcoGorelli closed 2 years ago
@s-weigand any objections here?
@dnoliver fancy trying this out? I think this should now work:
nbqa --nbqa-shell --nbqa-md "cspell lint" .
@MarcoGorelli I wanted to add an additional integration test with cspell
because python tools get better discovered than external ones.
And I ran into 2 problems:
pytest-randomly
and something not getting torn down like it should (I think anthony recently made a video about bisecting flaky tests :heart: )tests/data/notebook_with_spelling_error_in_md_cell.ipynb:2:1 - Unknown word (errror)
instead of
tests/data/notebook_with_spelling_error_in_md_cell.ipynb:cell_1:1:1 - Unknown word (errror)
Sadly I'm currently not at home to access my windows PC and my old laptop is a bit too weak to run a VM, SO I currently can't debug it properly. Maybe you got an idea of what the problem might be since you are a lot closer to the code and test base than me ^^
Flaky CI runs:
@MarcoGorelli works great :)
Tested it with this repo https://github.com/openvinotoolkit/openvino_notebooks. It took me a couple of minutes to find that contributing.rst
file and find the tox instructions :)
(venv) dnoliver $ nbqa --nbqa-shell 'cspell check --color' notebooks/001-hello-world/001-hello-world.ipynb
Check file: notebooks/001-hello-world/001-hello-world.ipynb
# %%NBQA-CELL-SEPae20a6
import cv2
import matplotlib.pyplot as plt
import numpy as np
from openvino.runtime import Core
# %%NBQA-CELL-SEPae20a6
ie = Core()
model = ie.read_model(model="model/v3-small_224_1.0_float.xml")
compiled_model = ie.compile_model(model=model, device_name="CPU")
output_layer = compiled_model.output(0)
You can't see it, but it is colorizing the flagged words :)
sometimes I get an additional spelling error that isn't there when rerun
It could be because of this:
we generate a random cell separator, and sometimes it could have some string of symbols that are detected as invalid words?
I've tried running this on Windows to check, but am getting
(base) C:\Users\User>npm install -g cspell
npm ERR! code EBUSY
npm ERR! syscall rename
npm ERR! path C:\Users\User\AppData\Local\npm-cache\_cacache\tmp\dbb8b7d8
npm ERR! dest C:\Users\User\AppData\Local\npm-cache\_cacache\content-v2\sha512\bf\29\a21c754f4203a3ddfc6808b2210b847e21bfc098ed857aebcb82726d85847d7d765845156176a3545fd710be090304d72188e59fee500dc6f8bbf8e75272
npm ERR! errno EBUSY
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/@cspell%2fcspell-pipe: EBUSY: resource busy or locked, rename 'C:\Users\User\AppData\Local\npm-cache\_cacache\tmp\dbb8b7d8' -> 'C:\Users\User\AppData\Local\npm-cache\_cacache\content-v2\sha512\bf\29\a21c754f4203a3ddfc6808b2210b847e21bfc098ed857aebcb82726d85847d7d765845156176a3545fd710be090304d72188e59fee500dc6f8bbf8e75272'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-09-15T20_33_17_877Z-debug-0.log
and can't figure out what to do about it. I've tried npm cache clear --force
but it didn't help
(note that on Linux I've managed to install it without issues)
Still unable to install cspell on Windows
we generate a random cell separator, and sometimes it could have some string of symbols that are detected as invalid words?
I think this is probably not an issue, as people can use ignoreRegExpList to ignore patterns
Tempted to just ship this, if there's issues running on Windows we can always revisit later
let's ship this for now - thanks @s-weigand and @dnoliver !
closes #738