Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive on CSpell due to @cspell/dict-win32 not being recognized #2500

Closed
mwarres opened this issue Mar 30, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@mwarres
Copy link
Contributor

mwarres commented Mar 30, 2023

Describe the bug
When we run CSpell through MegaLinter in CI, "nanoserver" and "ltsc", which are words in the CSpell's win32 dict, come up as false positives despite us having installed and configured the win32 dict.

To Reproduce
Steps to reproduce the behavior:

  1. Run yarn init.
  2. Run yarn add --dev @cspell/dict-win32@2.0.1.
  3. Paste in a minimal CSpell config that includes the CSpell win32 dict.
  4. Paste in a minimal MegaLinter config.
  5. Make a file containing the strings "ltsc" and "nanoserver".
  6. Make a GitHub Action test workflow to run MegaLinter.
  7. Push to GitHub and note that CSpell incorrectly fails on the words "ltsc" and "nanoserver".

Here is a minimum reproduction

Here is the PR where we had this problem: ScribeMD/docker-cache#475

Expected behavior
Expect CSpell to pass on the words "ltsc" and "nanoserver".

Thank you for your help!!!

@mwarres mwarres added the bug Something isn't working label Mar 30, 2023
@Kurt-von-Laven
Copy link
Collaborator

Notably, the issue does not occur when running CSpell directly (e.g., npx cspell@6.31.1 .). As a workaround, one can install the unbundled dictionary in question using a pre-command in one's MegaLinter config:

SPELL_CSPELL_PRE_COMMANDS:
 - command: "npm install @cspell/dict-win32@2.0.1"

Does anyone have any theories as to why CSpell wouldn't be able to import a dictionary when run through MegaLinter?

mwarres added a commit to ScribeMD/docker-cache that referenced this issue Mar 30, 2023
Eliminate the need to manually install the CSpell win32 dict locally in
order for the VS Code CSpell extension to have access to that
dictionary. Keep the manual installation pre-command for now; it is
a workaround for oxsecurity/megalinter#2500.
@nvuillam
Copy link
Member

I see you found a workaround, I close the issue :)
Please reopen if you think something can be done within MegaLinter (apart from adding all dictionaries by default in the docker image)

@Kurt-von-Laven
Copy link
Collaborator

Duplicate #1572 since this is also caused by the fact that CSpell can't see Yarn dependencies when not run via Yarn. This issue would also be addressed by accepting arrays in _CLI_EXECUTABLE, thereby allowing users to run CSpell via Yarn. Still open to better ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants