Handle empty stdin-display-name values
Apparently, some folks pass an empty string to --stdin-display-name. To
avoid the errors this causes, we need to handle it appropriately.
Closes#235
See merge request !129
Add --tee option to split report output stream.
The `--tee` option allows the linter report to be written to stdout, even
though it is being redirected to a file with the` --output-file` option.
This is useful if I want to store the report in a separate file for later
analysis but also be able to print the output on screen (e.g when running
in a CI environment).
See merge request !90
We opted to not copy the file_tokens attribute each time it's accessed
in the merge request discussion but it was never reflected in the code.
Further, the attribute had no documentation or docstring, so we've added
that. Finally, we address a personal style nit that I otherwise wouldn't
have picked at.
Handle SyntaxErrors after new-lines specially
In some cases, when we handle SyntaxErrors we need to ensure that the
column number is correct for a 1-indexed report. In some cases, we also
need to account for the fact that the SyntaxError has happened "after" a
new-line. To extract and alter the row and column numbers, we've moved
the logic to a private static method on the FileChecker object to avoid
an overly complex method.
Closes#237
See merge request !125
In some cases, when we handle SyntaxErrors we need to ensure that the
column number is correct for a 1-indexed report. In some cases, we also
need to account for the fact that the SyntaxError has happened "after" a
new-line. To extract and alter the row and column numbers, we've moved
the logic to a private static method on the FileChecker object to avoid
an overly complex method.
Closes#237
When a SyntaxError is raised, column_number may be None. Unfortunately,
it's not obvious where that None comes from so we must handle it in
handle_error.
Closes#214
There are rare cases when StyleGuide#handle_error might receive None
as the column_number. This adds the failing test to ensure we don't
regress the correct behaviour.
Related-to #214
Point documentation to http: instead of https:
The certificate at that URL is for `readthedocs.io`, so if you want to use https, it's best to use `flake8.readthedocs.io` and not `flake8.pycqa.org`. As it is currently, you get a certificate error.
Note also that the `Code of Conduct` and `Getting Started Contributing` links are using `http` and pointing to the insecure domain, so if you do want https, you should change those as well.
See merge request !118
The certificate at that URL is for `readthedocs.io`, so if you want to use https, it's best to use `flake8.readthedocs.io` and not `flake8.pycqa.org`. As it is currently, you get a certificate error.
Note also that the `Code of Conduct` and `Getting Started Contributing` links are using `http` and pointing to the insecure domain, so if you do want https, you should change those as well.
Add --bug-report flag to help bug reporters
When invoked it will print out JSON that has all of the debugging
information needed by the maintainers to diagnose or reproduce a bug.
Closes#207
See merge request !117
Replace list of violation codes
*Description of changes*
Replace the list of violation codes in the documentation.
*Related to:* #206
See merge request !115
Handle SyntaxErrors when tokenizing a file
*Description of changes*
This handles the SyntaxErrors raised by tokenize.generate_tokens.
*Related to:* #205
See merge request !114
Serialize Checkers PluginTypeManager to a dict
*Description of changes*
Try to side-step issues with attributes not being set/updated on plugins when used with multiprocessing and Queues.
*Related to:* #179, #164
See merge request !98