Commit graph

557 commits

Author SHA1 Message Date
Ian Cordasco
99bc94edaa Release notes and version bump for v2.5.0 2015-10-24 20:11:15 -05:00
Ian Cordasco
63b9a84367 Add a few more items to our gitignore 2015-10-24 18:39:53 -05:00
Ian Cordasco
7c08ee8c92 Bump pyflakes cap to 1.1.0 2015-10-24 18:39:24 -05:00
Ian Cordasco
ac87e2d71e Merge branch 'GeonU/flake8-bug-setuptools-options' 2015-10-07 22:09:20 -05:00
Ian Cordasco
d422325548 Rewrite some tests from !41 2015-10-07 22:09:04 -05:00
geonu
0cc12e22ae Add option_normalizer test code 2015-10-03 20:46:11 +09:00
geonu
186f41edcb Delete unnecessary function 2015-10-03 20:46:10 +09:00
geonu
0d006a3521 Delete unused import 2015-10-03 20:46:10 +09:00
geonu
28138a2135 Use option_normalizer 2015-10-03 20:46:10 +09:00
geonu
f67552d09a Add option_normalizer for setuptools 2015-10-03 20:46:10 +09:00
Ian Cordasco
bf19122741 Merge branch 'bug/67' into 'master'
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
2015-09-28 01:32:11 +00:00
Ian Cordasco
bf5baf1e0c Merge branch 'python-3.5' into 'master'
Update .travis.yml for Python 3.5



See merge request !40
2015-09-27 20:05:17 +00:00
Ian Cordasco
064661041d Update .travis.yml for Python 3.5 2015-09-27 15:04:49 -05:00
Ian Cordasco
7fb3dd6a74 Merge branch 'bug/90' into 'master'
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 #59
Closes #90

See merge request !39
2015-09-27 20:03:12 +00:00
Ian Cordasco
0c0eadc0a0 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 #59
Closes #90
2015-09-27 14:11:17 -05:00
Ian Cordasco
96cb23e2e7 Add --enable-extensions flag to Flake8
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
2015-09-27 10:08:23 -05:00
Ian Cordasco
5b7dc3927a 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
2015-09-27 10:08:23 -05:00
Luke Plant
b8457ebb24 Added link to flake8-respect-noqa extension. 2015-09-07 15:13:30 +00:00
Ian Cordasco
a1154e41df Merge branch 'bug/74' into 'master'
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
2015-08-23 00:59:33 +00:00
Ian Cordasco
9d734158ca Add tests around the OSError retry logic
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
2015-08-22 19:47:42 -05:00
Ian Cordasco
f1aa58889d Add a helper method for retrying checks in serial
This allows us to reuse the same code simply for check_files and
input_file. This should cover all uses of the StyleGuide methods.

Related to bug #74
2015-08-20 21:13:19 -05:00
Ian Cordasco
1c6c1f5116 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
2015-08-19 20:32:52 -05:00
Ian Cordasco
e847ed8bf0 Merge branch 'bug/69' into 'master'
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
2015-08-19 01:07:28 +00:00
Ian Cordasco
1ed78df61e Add a regression test for EPIPE IOErrors
This should prevent bug 69 from regressing in the future and provides a
framework for testing the addition of new errnos to the ingore list.
2015-08-18 20:02:58 -05:00
Ian Cordasco
d98e1729b3 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
2015-08-16 14:00:32 -05:00
Ian Cordasco
57ec990dad Merge branch 'master' into 'master'
docs: Adding flake8-import-order plugin to the list of available plugins

Solves #77

See merge request !34
2015-08-16 17:51:09 +00:00
Javier Domingo Cansino
7b7e1da0f4 docs: Adding flake8-import-order plugin to the list of available plugins 2015-08-11 08:32:43 +02:00
Ian Cordasco
d5c5feb651 Merge branch 'fix-mock-tests' into 'master'
Fix flake8 tests using mock to work with 1.1.x branch

See merge request !33
2015-07-10 14:59:53 +00:00
Ian Cordasco
a4a4a48667 Pin mock for py26 2015-07-10 09:46:57 -05:00
Ian Cordasco
b0f30f97fb Fix flake8 tests using mock to work with 1.1.x branch 2015-07-10 09:34:49 -05:00
Ian Cordasco
b827629b7a Use containers on Travis-CI 2015-07-10 08:47:44 -05:00
Ian Cordasco
58205ee455 Simplify Travis-CI config 2015-07-10 08:22:11 -05:00
Ian Cordasco
0a678913c9 Fix tests until we can understand why mock breaks 2015-07-10 08:21:24 -05:00
Ian Cordasco
71261c36cb Merge branch 'master' into 'master'
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
2015-07-10 13:18:12 +00:00
Michele Lacchia
f428a9fee3 Add radon to Existing Extensions section 2015-07-10 06:29:06 +00:00
Ian Cordasco
d7e17ed295 Update version identifier
This got lost in Vancouver somewhere
2015-06-02 13:25:49 -05:00
Ian Cordasco
86235e3528 Merge remote-tracking branch 'origin/master' 2015-06-02 13:24:39 -05:00
Ian Cordasco
f2b0bb52e5 Raise upper bound on pyflakes
Closes #61
2015-06-01 07:42:03 -05:00
Ian Cordasco
3ce1050d0f Update CHANGES for 2.4.1 2015-05-18 18:43:42 -05:00
Ian Cordasco
97dba87d1d Turn off dependency requirements
This is a quickfix to help openstack unbreak their gate requirements
2015-05-18 18:37:43 -05:00
Ian Cordasco
d41701df3b Only exclude known bad versions of pep8
Closes #51
2015-04-30 16:22:16 -05:00
Ian Cordasco
20ed95f70e Add Corey to the CONTRIBUTORS file 2015-04-30 16:20:02 -05:00
Tyrel Souza
daf043b7ae Fix parsing ignore
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)
2015-04-30 16:18:31 -05:00
Ian Cordasco
36b8e725fa Merge branch 'windows_docs_fix' into 'master'
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
2015-04-30 20:36:18 +00:00
Tyrel Souza
181cffda7f Add a note about Windows .flake8 config location 2015-04-30 16:23:18 -04:00
Ian Cordasco
9e95a7315e Merge branch 'master' into 'master'
Utilize generator expression instead of list comprehension

See merge request !28
2015-04-19 01:22:24 +00:00
Corey Farwell
5ba109ba93 Utilize generator expression instead of list comprehension 2015-04-18 01:22:37 -04:00
Ian Cordasco
159c4930e1 Merge branch 'bug/52' into 'master'
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
2015-04-06 15:45:16 +00:00
Ian Cordasco
12fab2f8ad 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
2015-04-05 23:01:44 -05:00
Ian Cordasco
ea628fa9d1 Merge branch 'fix_jobs_test_underscore' into 'master'
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
2015-03-17 03:50:31 +00:00