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
Document how it determines when the plugin is run
*Description of changes*
If a plugin's target (constructor or function) doesn't satisfy specific parameters, it'll never be called. This documents what the parameters must contain to be run at all.
*Related to:* #159
See merge request !110
It seems likely that the multiprocessing module on Windows is not
capable of serializing an object with the structure that we have and
preserving the attributes we dynamically set on plugins (like the
FlakesChecker). To avoid issues like this with all plugins (although
we have only found this on Windows with the FlakesChecker), let's try
serializing the Checkers PluginTypeManager to a dictionary so that the
only object that a Queue is really trying to serialize/deserialize is
the FlakesChecker itself.
Related to #179
Update GitLab CI configuration
*Description of changes*
Update GitLab CI. After reading [GitLab's blog post](https://about.gitlab.com/2016/07/29/the-basics-of-gitlab-ci/) about their CI system, it seems that we can easily start generating build artifacts for PRs and regular pushes.
*Related to:* N/A
See merge request !111
If a plugin's target (constructor or function) doesn't satisfy specific
parameters, it'll never be called. This documents what the parameters must
contain to be run at all.
Related to: #159