Previously we were not reading output_file or enable_extensions from
user provided configuration files. The configuration option name
provided to config_options needs to be hyphenated in order for pep8 to
recognize and parse out the option correctly. Also, the destination name
needs to match the configuration option name that pep8 looks for
otherwise it will raise an unhandled KeyError exception.
Adding docs for off by default
This adds documentation for the off_by_default option for extensions,
which was added in MR !14. Fixes#24.
Signed-off-by: Jason Myers <jason@jasonamyers.com>
See merge request !48
Right now, running the git and hg commands could easily raise an
OSError. Let's only catch it in those cases and then use else to
install hooks when those are successful. Otherwise, pass on to the next
supported VCS
Add a FAQ section to the readme
It seems like these two questions happen a lot, and are a source of strife. I know that many people won't read an FAQ, but at the very least, it will be a place to point people instead of, "Google for information."
See merge request !46
Cache stdin for Flake8 plugins
Currently plugins (e.g., flake8-docstrings) are struggling to support
users passing data in on stdin (e.g., cat file.py | flake8 -). Until
pep8 fixes this itself, we can monkey-patch its `stdin_get_value`
function to handle the caching for us.
Closes#105
See merge request !44
Currently plugins (e.g., flake8-docstrings) are struggling to support
users passing data in on stdin (e.g., cat file.py | flake8 -). Until
pep8 fixes this itself, we can monkey-patch its `stdin_get_value`
function to handle the caching for us.
Closes#105
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