summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Correct exclude paths in git hookIan Cordasco2016-11-131-0/+9
| | | | | | | | | When running the git hook, even though the appropriate config file is found and processed, the exclude patterns and paths were not being corrected to account for the temporary directory that we copy the files into. Related-to #223
* Prepare to release 3.1.0 on 2016-11-143.1.0b1Ian Cordasco2016-11-121-1/+1
|
* Exit non-zero if something goes wrong during a runIan Cordasco2016-11-121-1/+7
| | | | | | | | If we handle an exception, or early exit, or really anything, we should exit non-zero (and we used to). This was a minor oversight. Closes #209 Closes #248
* Merge branch 'bug/245' into 'master' Ian Cordasco2016-11-121-0/+8
|\ | | | | | | | | | | | | | | | | | | Do not print the source when provided with -q When users specify any number of -q's on the command-line, we should not show the source even if they have otherwwise configured Flake8 to do so. Closes #245 See merge request !140
| * Do not print the source when provided with -qIan Cordasco2016-11-111-0/+8
| | | | | | | | | | | | | | When users specify any number of -q's on the command-line, we should not show the source even if they have otherwwise configured Flake8 to do so. Closes #245
* | Actually remove enabled extensions from ignore listIan Cordasco2016-11-091-2/+9
|/ | | | | | | | When we enable a plugin (when it's provided in the --enable-extensions) plugin, we need to remove it both from the extended default ignore list and the plain ignore list. Closes #239
* Merge branch 'bug/223' into 'master' Ian Cordasco2016-11-091-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Change how we initialize our git hook application Look for configuration files in the current directory while checking the files in the temporary directory. Closes #223 Closes #210 See merge request !136
| * Change how we initialize our git hook applicationIan Cordasco2016-11-081-2/+2
| | | | | | | | | | | | | | | | Look for configuration files in the current directory while checking the files in the temporary directory. Closes #210 Closes #223
* | Exit early if the diff is emptyIan Cordasco2016-11-081-0/+2
|/ | | | | | | In case the provided diff is empty, do not run checks against any files, simply exit. Closes #226
* Merge branch 'master' into 'master' Ian Cordasco2016-11-091-0/+2
|\ | | | | | | | | Fixed E305: expected 2 blank lines after class or function definition See merge request !135
| * Fixed E305: expected 2 blank lines after class or function definitionOndřej Nový2016-11-081-0/+2
| |
* | Merge branch 'pycodestyle21' into 'master' Ian Cordasco2016-11-091-0/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add previous_unindented_logical_line attribute This attribute is introduced in pycodestyle 2.1.0 Closes #246 See: https://github.com/PyCQA/pycodestyle/issues/400 See merge request !134
| * | Add previous_unindented_logical_line attributeYen Chi Hsuan2016-11-081-0/+5
| |/ | | | | | | | | | | | | | | This attribute is introduced in pycodestyle 2.1.0 Closes #246 See: https://github.com/PyCQA/pycodestyle/issues/400
* | Handle a previously unhandled code scenarioIan Cordasco2016-11-081-15/+28
|/ | | | | | | | | | | Previously, we didn't handle the case where an error code was implicitly ignored (by not being in --select) and implicitly selected (by not being in --ignore). This means we need to update StyleGuide#_decision_for and StyleGuide#is_user_selected to handle these cases. Closes #242 Related-to #239 Related-to !132
* Handle empty stdin-display-name valuesIan Cordasco2016-10-281-1/+1
| | | | | | | Apparently, some folks pass an empty string to --stdin-display-name. To avoid the errors this causes, we need to handle it appropriately. Closes #235
* Fix bug with --enable-extensionsIan Cordasco2016-10-251-2/+3
| | | | | | | We went through an iteration where we supported --enable-extensions and then didn't. This adds back our support for --enable-extensions. Closes #239
* Merge branch 'master' into 'master' Ian Cordasco2016-10-252-1/+7
|\ | | | | | | | | | | | | | | | | | | | | Add --tee option to split report output stream. The `--tee` option allows the linter report to be written to stdout, even though it is being redirected to a file with the` --output-file` option. This is useful if I want to store the report in a separate file for later analysis but also be able to print the output on screen (e.g when running in a CI environment). See merge request !90
| * Add --tee option to split report output stream.Martin Domke2016-07-262-1/+7
| | | | | | | | | | | | | | | | The --tee option allows the linter report to be written to stdout, even though it is being redirected to a file with the --output-file option. This is useful if I want to store the report in a separate file for later analysis but also be able to print the output on screen (e.g when running in a CI environment).
* | Fix up FileProcessor.file_tokens propertyIan Cordasco2016-10-251-2/+9
| | | | | | | | | | | | | | | | We opted to not copy the file_tokens attribute each time it's accessed in the merge request discussion but it was never reflected in the code. Further, the attribute had no documentation or docstring, so we've added that. Finally, we address a personal style nit that I otherwise wouldn't have picked at.
* | Merge branch 'file-tokens' of xzise/flake8Ian Cordasco2016-10-251-0/+14
|\ \
| * | Add support for tokens of a complete fileFabian Neundorf2016-07-221-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `tokens` property of the `FileProcessor` class only contains tokens of the current line but not all tokens. So if a plugin which is only executed once per file, that property is useless. To make the tokens also available to plugins it is now be able to supply all the tokens of a file. It also updates the documentation to separate which parameters are static and which are changed on each line. Using the latter parameters on plugins which are only run once per file isn't very sensible.
* | | Change how we apply lazy to the git hookIan Cordasco2016-10-251-5/+8
| | |
* | | Merge branch 'patch-1' of skovorodkin/flake8Ian Cordasco2016-10-241-1/+1
|\ \ \
| * | | Consider `lazy` parameter in git.find_modified_files function Sergey2016-08-141-1/+1
| | | | | | | | | | | | Refer to https://gitlab.com/pycqa/flake8/blob/867727f30408d53d743b1b6bb3cba4b7d33039c6/old/flake8/hooks.py#L34
* | | | Handle SyntaxErrors after new-lines speciallyIan Cordasco2016-10-231-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, when we handle SyntaxErrors we need to ensure that the column number is correct for a 1-indexed report. In some cases, we also need to account for the fact that the SyntaxError has happened "after" a new-line. To extract and alter the row and column numbers, we've moved the logic to a private static method on the FileChecker object to avoid an overly complex method. Closes #237
* | | | Merge branch 'bug/214' into 'master' Ian Cordasco2016-08-281-1/+4
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Avoid TypeErrors when handling a SyntaxError See merge request !121
| * | | Ensure column_number is always an integerIan Cordasco2016-08-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a SyntaxError is raised, column_number may be None. Unfortunately, it's not obvious where that None comes from so we must handle it in handle_error. Closes #214
* | | | Spelling fixesVille Skyttä2016-08-131-1/+1
|/ / /
* | | Merge branch 'feature/207' into 'master' Ian Cordasco2016-08-113-2/+76
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add --bug-report flag to help bug reporters When invoked it will print out JSON that has all of the debugging information needed by the maintainers to diagnose or reproduce a bug. Closes #207 See merge request !117
| * | | Add --bug-report flag to help bug reportersIan Cordasco2016-08-073-2/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoked it will print out JSON that has all of the debugging information needed by the maintainers to diagnose or reproduce a bug. Closes #207
* | | | Bump version to 3.1.0.dev0Ian Cordasco2016-08-101-1/+1
| | | |
* | | | Set version to 3.0.43.0.4Ian Cordasco2016-08-071-1/+1
|/ / /
* | | Handle SyntaxErrors when tokenizing a fileIan Cordasco2016-08-062-8/+5
| | | | | | | | | | | | Closes #205
* | | Merge branch 'release-notes/3.0.4' into 'master' Ian Cordasco2016-08-051-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set version to 3.0.4 and start release notes *Description of changes* Start tracking release notes for 3.0.4 See merge request !113
| * | | Set version to 3.0.4 and start release notesIan Cordasco2016-08-051-1/+1
| | | |
* | | | Merge branch 'bug/179' into 'master' Ian Cordasco2016-08-055-25/+56
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Serialize Checkers PluginTypeManager to a dict *Description of changes* Try to side-step issues with attributes not being set/updated on plugins when used with multiprocessing and Queues. *Related to:* #179, #164 See merge request !98
| * | | Set-up default attributes for FlakesCheckerbug/179Ian Cordasco2016-08-031-0/+3
| | | |
| * | | Serialize Checkers PluginTypeManager to a dictIan Cordasco2016-08-034-25/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems likely that the multiprocessing module on Windows is not capable of serializing an object with the structure that we have and preserving the attributes we dynamically set on plugins (like the FlakesChecker). To avoid issues like this with all plugins (although we have only found this on Windows with the FlakesChecker), let's try serializing the Checkers PluginTypeManager to a dictionary so that the only object that a Queue is really trying to serialize/deserialize is the FlakesChecker itself. Related to #179
* | | | Clean up usage of InvalidSyntax exceptionIan Cordasco2016-08-052-4/+9
| | | |
* | | | Do not treat AttributeError as if it were an IOErrorWouter Bolsterlee2016-08-051-7/+2
| | | | | | | | | | | | | | | | | | | | ...and avoid .strerror altogether since py3 does not have it. See #203.
* | | | Use str(exc) instead of exc.messageWouter Bolsterlee2016-08-051-1/+1
|/ / / | | | | | | | | | | | | ...since on py3 tokenize.TokenError does not have a 'message' attribute. See #203.
* | | Bump version for v3.0.33.0.3Ian Cordasco2016-07-301-1/+1
| | | | | | | | | | | | Update release date as well
* | | Reset Application.formatter attribute in init_reportIan Cordasco2016-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | For our Legacy API users, StyleGuide.init_report should reset the formatter attribute before calling Application.make_formatter(). Closes #200
* | | Re-allow for relative paths for excludeIan Cordasco2016-07-292-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, all testing was done from the directory in which the configuration file lived, so this bug went unnoticed. However, if you run Flake8 against its own source from a directory above, you would notice that the patterns in the exclude config value in tox.ini were ignored. This is because we (like any reasonable person) are using relative paths. The path is relative, however, to the directory in which the configuration file was located. So we keep track of which directory that is and use that to normalize the paths in the config file. Yes, there is an unrelated change to our tox.ini in this commit as well. ;-) Closes #194
* | | Open our output file in append mode alwaysIan Cordasco2016-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | This avoid overwriting portions of our log output when using Flake8 in verbose mode. Closes #193
* | | Report errors when run via setuptools.Alex Wood2016-07-291-0/+5
| | | | | | | | | | | | Closes #199
* | | Diable multiprocessing behaviour on WindowsIan Cordasco2016-07-292-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | Due to https://bugs.python.org/issue27649, we cannot continue to expect multiprocessing to work as we expect and document it on Windows. As such, we are going to revert back to our previous behaviour of disabling it across all versions of Python on Windows to provide the default expected behaviour of Flake8 on that Operating System.
* | | Allow plugins that are on by default to be ignoredIan Cordasco2016-07-282-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, to ensure that plugins on by default were reported, we added them to the select list. This means that ignoring them became impossible. To accomodate our reporting logic and a user's ability to ignore, we need to keep our select and extended select lists separated. This allows us to have a better understanding of who is selecting what, where, and how and make our decision as to whether or not an error should be reported more wisely. Closes #195
* | | Raise exception when entry_point not callableMarc Abramowitz2016-07-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g.: ``` $ .tox/flake8/bin/flake8 mobileweb Traceback (most recent call last): File ".tox/flake8/bin/flake8", line 9, in <module> load_entry_point('flake8', 'console_scripts', 'flake8')() File "/Users/marca/dev/git-repos/flake8/src/flake8/main/cli.py", line 16, in main app.run(argv) File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 316, in run self._run(argv) File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 299, in _run self.initialize(argv) File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 289, in initialize self.find_plugins() File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 143, in find_plugins self.check_plugins.load_plugins() File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 375, in load_plugins plugins = list(self.manager.map(load_plugin)) File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 267, in map yield func(self.plugins[name], *args, **kwargs) File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 373, in load_plugin return plugin.load_plugin() File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 173, in load_plugin raise failed_to_load flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "P999" due to Plugin <module 'teamcity.flake8_plugin' from '/Users/marca/dev/git-repos/teamcity-messages/teamcity/flake8_plugin.pyc'> is not a callable. It might be written for an older version of flake8 and might not work with this version. ``` This is nicer than the previous behavior of raising an obscure `PicklingError` and then hanging. ``` $ .tox/flake8/bin/flake8 mobileweb Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 268, in _feed send(obj) PicklingError: Can't pickle <type 'module'>: attribute lookup __builtin__.module failed ``` See #164
* | | Sort reports by line and columnFabian Neundorf2016-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Originally the reports have been sorted by column and message (without the error code), so it didn't order after the line number. Closes #196