Repository navigation
fix(codespell): keep diagnostics when --count is used - #354
Merged
Merged
Conversation
Codespell writes diagnostics to stdout and exits with code 65 when misspellings are found. Passing `--count` via `extra_args` or project config writes the error count to stderr. Setting `from_stderr = true` caused `generator_factory` to overwrite stdout diagnostics with that stderr count. Set `from_stderr = false` with `ignore_stderr = true` and allow exit codes 0 and 65. Fixes nvimtools#149
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #149
When
codespellfinds spelling mistakes it prints them to stdout and exits with code 65. If--countis enabled inextra_argsor in a config file it also prints the error count to stderr.Right now the builtin sets
from_stderr = trueand does not allow exit code 65. With--countenabled none-ls reads the count from stderr and drops the spelling warnings from stdout.This change:
from_stderr = falseandignore_stderr = trueso none-ls reads stdoutcheck_exit_codefor codes0and65test/spec/builtins/diagnostics/codespell_spec.luafor output parsing and--countTested locally with
make FILE=test/spec/builtins/diagnostics/codespell_spec.lua test-file(9/9 passed) plusstylua --check lua/ test/andselene lua/.Checklist
understand it should be contributed to
nvimtools/none-ls-extras.nvim
instead