Commit graph

619 commits

Author SHA1 Message Date
Ian Cordasco
6b27451e57 Merge branch 'feature/output-file' into 'master'
Add --output-file option

Addresses #15

This is, however, unfortunately affected by #17. That will need to be fixed before this can be merged.

See merge request !15
2014-12-27 15:33:31 +00:00
Ian Cordasco
8adb88cf11 Add --output-file option
Closes #15
2014-12-27 09:07:10 -06:00
Ian Cordasco
c761d22876 Merge branch 'feature/register-optional-checks' into 'master'
Allow for optional checks

See merge request !14
2014-12-27 15:05:11 +00:00
Ian Cordasco
a239fe7b1c Merge branch 'fix-17' into 'master'
flush() for each line

Fixes #17

See merge request !16
2014-12-27 15:00:56 +00:00
INADA Naoki
776b93a72b Fix missing import 2014-12-27 19:25:30 +09:00
INADA Naoki
2eec485a65 flush() for each print() 2014-12-27 18:03:53 +09:00
Ian Cordasco
2d5a6b1670 Prevent unintended behaviour modifying options.ignore
Previously, it was entirely plausible for us to remove something from
options.ignore overzealously. This is more confined logic and much more akin
to what I was intending the behaviour to be.
2014-12-18 15:25:37 -06:00
Ian Cordasco
b301532636 Add ability to turn checks off by default 2014-12-18 15:11:26 -06:00
Ian Cordasco
07677578b4 Merge branch 'feature/continuous-integration' into 'master'
Continuous Integration Updates

- Add `.travis.yml` for GitHub (first set of tests were run [here](https://travis-ci.org/PyCQA/flake8/builds/44403113))

- Update `tox.ini` to add

 - `py25` environment

 - `py{27,34}-flake8` environments

See merge request !12 (https://gitlab.com/pycqa/flake8/merge_requests/12)
2014-12-18 01:29:15 +00:00
Ian Cordasco
18c51d0d25 Add configuration so Travis will run on our mirror 2014-12-17 18:55:24 -06:00
Ian Cordasco
a152f10d4c Ensure flake8 passes itself in tests 2014-12-17 18:51:57 -06:00
Ian Cordasco
48a256b583 Merge branch 'extra_include_eggs' into 'master'
Extra include eggs

Add `.eggs` and `*.egg` to `EXTRA_EXCLUDE`

This is because these are usually downloaded by setuptools and they're usually other people's code so you don't want to check them.

```
[marca@marca-mac2 requests-unixsocket]$ flake8
./.eggs/pbr-0.10.0-py2.7.egg/pbr/packaging.py:740:17: E265 block comment should start with '# '
./pbr-0.10.0-py3.4.egg/pbr/packaging.py:740:17: E265 block comment should start with '# '
```

See merge request !10
2014-12-06 04:19:58 +00:00
Ian Cordasco
73b334a6e4 Merge branch 'master' into 'master'
Exit Flake8Command.run() cleanly if style checks pass

When using distutils/setuptools, it is common to perform several commands in sequence. For example: `python setup.py flake8 bdist_egg`. When `run()` exits by raising a `SystemExit` exception, it causes the entire chain to break - meaning flake8 cannot be used in combination with any other command.

This change simply alters the behavior to exit normally if there were no style violations found. Otherwise, it will exit immediately, as before, with a non-zero exit code.

See merge request !8
2014-12-06 03:49:30 +00:00
Marc Abramowitz
d95cf46f72 Add .eggs and *.egg to EXTRA_EXCLUDE 2014-11-25 10:24:27 -08:00
Ian Cordasco
997d291b9f Merge branch 'testing' into 'master'
Add first pass at integration style tests

See merge request !9
2014-11-14 19:08:05 +00:00
Michael Penkov
218949a3aa Correctly handle exclude patterns in git_hook 2014-11-11 21:15:58 +09:00
Joe Gordon
8b4bbd23bf Add first pass at integration style tests
In order to better prevent regressions (such as related to concurrency),
Add a integration test framework to simulate running flake8 with
arguments.
2014-10-31 20:45:59 -07:00
Josh
236e0f0ea1 Do not exit early if style checks pass 2014-10-28 06:02:24 +00:00
Ian Cordasco
247877b7c5 Prepare release 2.2.5 2014-10-19 21:26:24 -05:00
Ian Cordasco
467233f185 Merge branch 'flush_stdout' into 'master'
Flush stdout

As noted in email, it seems that failing to flush stdout in the sub-processes means that some output might go missing. I've observed this in practice with Syntastic in Vim. Here I flush both stdout and stderr before sending the message back to the main process that will allow it to continue. This makes the problem disappear for me.

It occurs to me that if sub-processes are producing output independently, there is also be a risk that they will badly interleave their output. I haven't looked into this - my primary concern is invocation for a single file at a time.

See merge request !7
2014-10-20 01:31:31 +00:00
Weeble
6e08711622 Flush all subprocess output before exit
Subprocesses write to stdout. They must flush their output before the
main process exits to avoid losing output or confusing the calling
program.
2014-10-19 18:06:19 +01:00
Ian Cordasco
26f909b282 Merge branch 'ignore' into 'master'
make flake8 pass in dirty flake8 root directory

See merge request !6
2014-10-15 22:14:16 +00:00
Joe Gordon
dc5ffac75c Make flake8 pass in root directory
Add exclude list to tox.ini
2014-10-15 15:07:12 -07:00
Ian Cordasco
832ecb63aa Merge branch 'setupdevelop' into 'master'
Add usedevelop to tox.ini

See merge request !5
2014-10-15 21:06:55 +00:00
Ian Cordasco
bc0985787d Loosen the regular expression search
I have seen people who place the comment at the bottom of the file and it
would be backwards incompatible if we did anything but preserve it as a search
instead of match
2014-10-15 15:47:52 -05:00
Joe Gordon
edafc04972 Make _flake8_noqa tighter
Only match '\s*# flake8[:=]\s*nqa' when it happens at the beginning of a
line. The previous version of this regex is incorrectly hitting the
following line:

        # Any "# flake8: noqa" line?

Causing flake8 to not be run on engine.py.
Also fix flake8 issues in engine.py.
2014-10-15 15:47:52 -05:00
Ian Cordasco
a059cb79fd Merge branch 'git' into 'master'
Add a .gitignore file

See merge request !3
2014-10-15 15:26:57 +00:00
Joe Gordon
ab849a9931 Have tox install via setup.py develop
Tox 1.6 has a feature to install code into the virtualenv via 'setup.py
develop' This makes it easier to source the tox virtualenv and test code
changes.
2014-10-14 15:30:50 -07:00
Joe Gordon
a70fc46347 Add a .gitignore file 2014-10-14 13:15:33 -07:00
Ian Cordasco
2cf10d26a3 Release v2.2.4 2014-10-09 16:56:01 -05:00
Ian Cordasco
7fd24c2983 Make --install-hook work without config files
In short, pep8's option processing would bomb out if there were neither args
provided or config files present (setup.cfg, tox.ini, .pep8, ...).
--install-hook should work regardless of whether a config file is present or
not, so we use a callback to add an argument to the parser's internal argument
list and skip the check altogether. Links for context are in the comments in
this diff.
2014-10-09 16:44:52 -05:00
Ian Cordasco
be67f9784b Only initialize options.exclude if it is false-y
Fixes #4 on GitLab
2014-10-09 14:58:48 -05:00
Ian Cordasco
69ed788443 When run as a setuptools command, the previous fix breaks flake8 2014-10-09 14:24:45 -05:00
Ian Cordasco
25c4f52afa Fix GitLab #3 by actually excluding .tox
This preserves backwards compatibility in the event someone was using
EXTRA_IGNORE as it should have been used
2014-10-09 14:09:36 -05:00
Ian Cordasco
752790e4ea Merge branch 'git_hook-file_pattern_match' into 'master'
Git hook file pattern match

I found that with the git hook installed, flake8 was failing to check some files. Upon examination, I found that the hook is coded to only consider files ending in '.py'. This works out to be an override of the expected behavior, which is to honor the "filename" option in tox.ini.

See merge request !1
2014-10-03 14:01:18 +00:00
Chris Buccella
c0dd7c870c Honor file pattern matching for git hook
In a config file, a user can use the "filename" option to specify
a pattern for matching filenames. The git hook effectively ignores
this and only checks files ending in '.py'
2014-09-23 00:54:39 -04:00
Ian Cordasco
876e283d38 Refactor Lukasz's work 2014-09-13 12:38:25 -05:00
Joseph Kahn
51955f9664 got rid of extra line added by accident. 2014-09-13 12:13:04 -05:00
Joseph Kahn
a4017bb090 Added my own extensions to the known extensions list, shameless self promotion. 2014-09-13 12:12:59 -05:00
Lukasz Dobrzanski
e6e655536c Applied icordasc PR comments 2014-09-13 12:12:23 -05:00
Lukasz Dobrzanski
cbba9faf9e Fix SIGINT when running on multiprocessing
^C was making the script hang (few scenarios possible).
This patch makes sure that the queue operations won't block forever.

Potentially related to #167
2014-09-13 12:11:32 -05:00
Ian Cordasco
e6cb9528d3 Disable multiprocessing when using stdin
Fixes #165
2014-09-12 22:36:37 -05:00
Ian Cordasco
79c80c3181 Move fix for #164 2014-09-12 16:50:54 -05:00
Ian Cordasco
552e298a2c Disable --jobs on Windows
Fixes #164
2014-09-12 16:49:34 -05:00
Ian Cordasco
34a2c12be8 Disable multiprocessing when using --diff
Fixed #166
2014-09-11 20:14:07 -05:00
Ian Cordasco
475b5a386e Merged in lukmdo/flake8/switch_use_unitest (pull request #48)
Use unittest.mock if available
2014-09-09 20:32:01 -05:00
Lukasz Dobrzanski
c3d7e68a2b Use unittest.mock if available
Use unittest.mock https://docs.python.org/3/library/unitetst.mock.html
starting from >= Python 3.3
2014-09-10 01:15:01 +01:00
Ian Cordasco
02b955453e Release v2.2.3 2014-08-25 19:03:13 -05:00
Ian Cordasco
568d7751eb Release v2.2.3 2014-08-25 19:02:46 -05:00
Ian Cordasco
dec58991d6 Actually enable auto job configuration by default 2014-08-25 19:01:40 -05:00