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-negative for setuptools in CSpell #1942

Closed
mwarres opened this issue Oct 7, 2022 · 3 comments · Fixed by #1984
Closed

False-negative for setuptools in CSpell #1942

mwarres opened this issue Oct 7, 2022 · 3 comments · Fixed by #1984
Labels
bug Something isn't working

Comments

@mwarres
Copy link
Contributor

mwarres commented Oct 7, 2022

I'm getting a false-negative for CSpell when "setuptools" is removed from the custom dictionary; see ScribeMD/docker-cache#177. This only occurs when CSpell is run through MegaLinter via pre-commit (as it is in our CI pipeline), but not when CSpell is run through the command line or when CSpell is run through MegaLinter without pre-commit.

A false-negative occurs in the following scenarios:

The correct behavior (successfully catching setuptools as an unrecognized word) occurs in the following scenarios:

  • Running CSpell directly in ScribeMD/docker-cache with npx cspell "**"

  • Running MegaLinter directly in ScribeMD/docker-cache with:

    npx -- mega-linter-runner@v6.10.0 --containername megalinter-full --remove-container --fix \
      --env CLEAR_REPORT_FOLDER=true --env LOG_LEVEL=debug --flavor javascript --release v6.10.0 
    

    or with LOG_LEVEL=warning

  • Running through our CI pipeline in other repos; see ci(dictionary): Add python-common dictionary ScribeMD/.github#85

  • Incorrectly changing our pre-commit config so that instead of:

    - id: megalinter-incremental
      args: &megalinter-args [--flavor, javascript, --release, v6.10.0, --env, LOG_LEVEL=debug]

    I had:

    - id: megalinter-incremental
      args: &megalinter-args [--flavor, javascript, --release, v6.10.0, LOG_LEVEL=debug]

    and then running MegaLinter via pre-commit with the following command:
    poetry run pre-commit run --all-files --hook-stage push.

Expected behavior: CSpell should catch setuptools as an unrecognized word. The output should include /tmp/lint/poetry.toml:6:4 - Unknown word (setuptools). Note: I erroneously thought it was included in CSpell's python dictionary but it is not; it is in the python-common dictionary.

Additional pertinent information: after running poetry run pre-commit run --all-files --hook-stage push on ScribeMD/docker-cache, the megalinter.log consists of the following output:

MARKDOWN_REMARK_LINT has been temporary disabled in MegaLinter, please use a previous MegaLinter version or wait for the next one !
[File listing] Input file /tmp/lint/"poetry.toml not found
[File listing] Input file /tmp/lint/src/post.ts" not found

I'm noticing the stray quotes in lines two and three. Consequently, I suspect that this bug has something to do with the interaction of quotation marks in pre-commit and MegaLinter.

Thanks for looking into this! I'm curious to see what you think!!

@mwarres mwarres added the bug Something isn't working label Oct 7, 2022
Kurt-von-Laven added a commit that referenced this issue Oct 20, 2022
The extra quotes caused MegaLinter to fail to find the first and last
files in the list, because the first has a literal double quote
character prepended to it, and the last has one appended to it.
Kurt-von-Laven added a commit that referenced this issue Oct 20, 2022
The extra quotes caused MegaLinter to fail to find the first and last
files in the list, because the first has a literal double quote
character prepended to it, and the last has one appended to it.
Kurt-von-Laven added a commit that referenced this issue Oct 21, 2022
The extra quotes caused MegaLinter to fail to find the first and last
files in the list on non-Windows platforms, because the first has a
literal double quote character prepended to it, and the last has one
appended to it. Stop passing Windows arguments verbatim to eliminate
the need for the quotes on Windows.
Kurt-von-Laven added a commit that referenced this issue Oct 22, 2022
The extra quotes caused MegaLinter to fail to find the first and last
files in the list on non-Windows platforms, because the first has a
literal double quote character prepended to it, and the last has one
appended to it. Stop passing Windows arguments verbatim to eliminate
the need for the quotes on Windows.
nvuillam added a commit that referenced this issue Oct 22, 2022
* Remove unnecessary spawnSync options.

The detached option defaults to false, and the cwd option defaults to
the current working directory, so there is no need to specify them.

* Don't retrieve spawnRes properties individually.

This isn't necessary and gives the misleading impression that stdout
and stderr may contain something. They cannot since the Docker image
is run with stdio: "inherit", meaning the stdio and stderr streams are
passed through to/from the mega-linter-runner process and hence aren't
captured.

* Don't add literal " character to filenames (#1942)

The extra quotes caused MegaLinter to fail to find the first and last
files in the list on non-Windows platforms, because the first has a
literal double quote character prepended to it, and the last has one
appended to it. Stop passing Windows arguments verbatim to eliminate
the need for the quotes on Windows.

Co-authored-by: nvuillam <nicolas.vuillamy@gmail.com>
@mwarres
Copy link
Contributor Author

mwarres commented Oct 24, 2022

Thank you for fixing this!!!

@nvuillam
Copy link
Member

@mwarres please can you confirm it's all ok with latest version ? :)

@mwarres
Copy link
Contributor Author

mwarres commented Oct 26, 2022

Confirmed!!

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

Successfully merging a pull request may close this issue.

2 participants