Add machine-readable output format, and test #3473
Open
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.
Passing
--machine-readable
/-m
to codespell, or settingmachine-readable = true
in the config file, will enable an output format designed to be more easily parsed, and containing the start column of the match (usually not output).Inspired by the
eslint -f compact
format (which is no longer part of standard eslint), but with an added@
at the start of each line. (Useful when combined with context or summary options, to parse only the lines containing error data).Intended primarily for actions-codespell and other wrapper scripts.
A new test,
test_machine_readable
, is added totest_basic.py
to verify basic functionality of the new option.The output, specifically, takes the form:
Line and column numbers are 1-based (
i + 1
andmatch.start() + 1
in the code, respectively).