Remove enabled extensions from `options.select`
When taking advantage of the --select flag for off-by-default
extensions, we neglected to take into account the fact that leaving the
extension names in the select list would cause different behaviour in
pep8. This should remedy this.
Related to GitLab bug #67
----
cc @joe-gordon0
See merge request !37
Add better logic for loading entry points
As noted in the code, setuptools 11.3 deprecated EntryPoint.load and
its require parameter. Starting with 11.3 the preferred way is use
EntryPoint.require and EntryPoint.resolve as necessary. Unfortunately,
those methods do not exist in all versions of setuptools. So we have
to check for them and use them when they're available. Otherwise, we
fallback to using EntryPoint.load with the require parameter.
Closes#59Closes#90
See merge request !39
As noted in the code, setuptools 11.3 deprecated EntryPoint.load and
its require parameter. Starting with 11.3 the preferred way is use
EntryPoint.require and EntryPoint.resolve as necessary. Unfortunately,
those methods do not exist in all versions of setuptools. So we have
to check for them and use them when they're available. Otherwise, we
fallback to using EntryPoint.load with the require parameter.
Closes#59Closes#90
This new flag is added so that off-by-default extensions can be enabled
without using --select which (currently) causes several problems with
pep8's rule engine. This also adds support to the --enable-extensions
flag to be specified as a multi-line config option in an appropriate
config file.
Closes GitLab #67
When taking advantage of the --select flag for off-by-default
extensions, we neglected to take into account the fact that leaving the
extension names in the select list would cause different behaviour in
pep8. This should remedy this.
Related to GitLab bug #67
Refactor how we use StyleGuides for better error recovery
In bug 74 we discovered that there are some less than ideal problems
around our use of multiprocessing. This is a first attempt at fixing
74 by using a fake StyleGuide object which proxies to the real one,
and will catch and handle exceptions and then posibly retry the
operation we were trying to perform in the first place.
Currently we're only implementing that logic for StyleGuide.check_files
but we should be careful to implement this in other functions used in
hooks and elsewhere.
Note: there may be a simpler way to fix this with a context manager
that will do the right thing. That may also prove simpler to implement
but that will have a much larger impact on the code-base than this.
Related to bug #74
See merge request !36
This updates our retry logic to be more specific in catching OSErrors
and it adds specific tests to show that it works and properly
re-initializes the StyleGuide with the pep8.StandardReport class so we
can fall back on serial behaviour gracefully.
Closes#74
In bug 74 we discovered that there are some less than ideal problems
around our use of multiprocessing. This is a first attempt at fixing
74 by using a fake StyleGuide object which proxies to the real one,
and will catch and handle exceptions and then posibly retry the
operation we were trying to perform in the first place.
Currently we're only implementing that logic for StyleGuide.check_files
but we should be careful to implement this in other functions used in
hooks and elsewhere.
Note: there may be a simpler way to fix this with a context manager
that will do the right thing. That may also prove simpler to implement
but that will have a much larger impact on the code-base than this.
Related to bug #74
Handle EPIPE IOErrors when using more than 1 job
If someone is using flake8 and piping it to a command like `head`, the
command they are piping flake8's output too may close the pipe earlier
than flake8 expects. To avoid extraneous exception output being printed,
we now catch IOErrors and check their errnos to ensure they're something
we know we can ignore.
This also provides flexibility to add further errnos for ignoring on a
case-by-case basis.
Closes#69
See merge request !35
If someone is using flake8 and piping it to a command like `head`, the
command they are piping flake8's output too may close the pipe earlier
than flake8 expects. To avoid extraneous exception output being printed,
we now catch IOErrors and check their errnos to ensure they're something
we know we can ignore.
This also provides flexibility to add further errnos for ignoring on a
case-by-case basis.
Closes#69
Add radon to Existing Extensions section
As per the title, just a small addition do the Extensions page of the docs. Related to #73
See merge request !32
https://gitlab.com/pycqa/flake8/issues/40
* Adding an ignore option in [flake8] wasn't working because pep8.StyleGuide
turned the string sent in into a tuple, which the option parser needs to receive
as an iterable that isn't a string. Split on spaces, commas, or semicolons using
re.findall in order to get a list of error/warnings to pass to StyleGuide
properly.
* Add self to contributors
(cherry picked from commit 8f8a7d458f)
Add a note about Windows .flake8 config location
The user docs state that configuration is done in ~/.config/flake8, but on Windows it's in ~/.flake8 instead.
I updated the docs per MergeRequest #49 request.
See merge request !30
Change the git-hook ignore default to None
When ignore is an empty string, it will apparently not run any checks at
all. Using None as the default ensures that it does run the appropriate
checks.
Closes#52
See merge request !27
When ignore is an empty string, it will apparently not run any checks at
all. Using None as the default ensures that it does run the appropriate
checks.
Closes#52
Fix jobs test on Windows
Rename the test_warnings.py file to \_test_warnings.py, so that it is not discoverable by nose. Run the tests in \_test_warnings.py separately. Fixes issue pycqa/flake8#44.
See merge request !26