Commit graph

537 commits

Author SHA1 Message Date
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
Christian Long
ef3a47a155 Move test back where it was 2015-03-16 19:27:39 -05:00
Christian Long
63d8af6af5 Document the other things I tried 2015-03-16 19:12:46 -05:00
Christian Long
7663dbd485 Run some tests separately 2015-03-16 18:21:57 -05:00
Christian Long
59d632e0bf Rename file 2015-03-16 18:21:56 -05:00
Ian Cordasco
e8460dfe51 Merge branch 'fix_hook_test' into 'master'
Fix hook test

Fix the git hook test on Windows.

Closes #43

See merge request !24
2015-03-12 03:01:38 +00:00
Christian Long
5dffadd67b Shorten variable name. Add comments 2015-03-11 21:20:28 -05:00
Christian Long
02308dab2a Fix hook test on Windows
This test was failing on Windows, for several reasons. Number one, the paths
for the hook test were hard-coded with forward slashes as path separators. I
replaced those with calls to os.path.join. Number two, the drive letter was
getting in the way of the path manipulation. On Windows, I'm using
os.path.splitdrive to fix that.
2015-03-11 19:50:31 -05:00
Ian Cordasco
c51702e9f0 Add notes for merge request 23 2015-03-10 22:03:55 -05:00
Ian Cordasco
de281ff1f0 Merge branch 'master' into 'master'
Fix issue #39

Only raise SystemExit if there is an error.

See merge request !23
2015-03-11 03:00:42 +00:00
Michael McNeil Forbes
dca5551156 Removed some unused testing code. 2015-03-09 11:27:15 -07:00
Michael McNeil Forbes
1fd8b66174 Fix issue #39. 2015-03-08 21:14:50 -07:00
Michael McNeil Forbes
da2b0b8a43 Added test demonstrating issue #39 2015-03-08 21:13:01 -07:00
Ian Cordasco
ea456614b5 Update version and release notes for 2.4.0 2015-03-07 20:42:08 -06:00
Ian Cordasco
6536f2285d Merge branch 'tox_remove_py25' into 'master'
Tox remove py25

Now maybe py25 is important to support and maybe you have a CI process that installs some older version of tox so that you can test Python 2.5, in which case you can close this, though if that's the case then maybe we should make a note of that fact and what version of tox to use, etc.

See merge request !22
2015-03-08 02:24:17 +00:00
Ian Cordasco
a66815ffa6 Merge branch 'christianmlong/issue/8' 2015-03-07 20:22:11 -06:00
Ian Cordasco
a6fc242c5e Slightly simplify our conditionals
Test warnings by default
2015-03-07 20:21:58 -06:00
Ian Cordasco
0e2b873c38 Add compatibility layer for Python 2.6
os.path.relpath on Python 2.6 returns slightly different output than it
does on 2.7. Rather than try to write tests around the behaviour, it
makes sense to have a common relpath function that behaves the same on
every version.
2015-03-06 23:43:36 -06:00
Ian Cordasco
7ab30a747f Merge branch 'local/pr/2'
Conflicts:
	flake8/hooks.py
2015-03-06 23:26:44 -06:00
Ian Cordasco
c084211e9e Merge remote-tracking branch 'origin/gh/2' 2015-03-06 23:04:49 -06:00
Ian Cordasco
84c8dd5e8d Simplify @mpenkov's fix for exclude in git hooks
The simpler fix is to ensure that the filename isn't the full path to
the temporary file before we check to see if it should be excluded or if
it should even match.

This also fixes a bug I found while testing the pull request in which no
files are checked.
2015-03-06 23:01:30 -06:00