summaryrefslogtreecommitdiff
path: root/src/flake8/processor.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow noqa to apply to lines due to continuationnoqa_continuationAnthony Sottile2020-03-171-7/+44
|
* split lines the same when read from stdinAnthony Sottile2020-01-161-1/+1
|
* application: Inline creation of config.ConfigFileFinderEric N. Vander Weele2019-12-031-3/+2
| | | | | | Simplify the initialization code path by invoking `config.ConfigFileFinder` directly instead of the extra hop by calling the static class-level `Application.make_config_finder()` method.
* Fix codesByeonghoon Yoo2019-11-061-5/+4
|
* Fix lint errorByeonghoon Yoo2019-11-051-1/+2
|
* Fix should_ignore_file() to handle disable-noqa configurationByeonghoon Yoo2019-11-051-1/+1
|
* Add disable_noqa attribute to FileProcessorByeonghoon Yoo2019-11-051-0/+3
|
* Merge branch 'specific_noqa_pycodestyle' into 'master'Anthony Sottile2019-10-281-5/+3
|\ | | | | | | | | | | | | Do not pass `noqa` to plugins, have flake8 decide whether to report Closes #552 See merge request pycqa/flake8!331
| * Do not pass `noqa` to plugins, have flake8 decide whether to reportAnthony Sottile2019-08-291-5/+3
| |
* | Don't reset indent_char when we encounter E101Anthony Sottile2019-09-241-6/+0
| |
* | Add type annotations for flake8.processorAnthony Sottile2019-09-071-30/+42
|/
* mypy now passesAnthony Sottile2019-05-191-4/+6
|
* whitelist a bandit false positive and improve type annotationAnthony Sottile2019-05-191-3/+3
|
* Ensure exceptions are pickleableAnthony Sottile2019-02-191-1/+1
|
* Remove noqa comments now that 3.7 has been releasedAnthony Sottile2019-01-311-1/+1
|
* Latest pycodestyleAnthony Sottile2019-01-291-0/+3
|
* Some lint / mypy fixesAnthony Sottile2019-01-241-1/+2
|
* Fix typoAnthony Sottile2018-12-311-1/+1
|
* Remove workarounds for older, unsupported PythonsJon Dufresne2018-12-051-17/+0
|
* Revert "Merge branch 'revert-63b91c95' into 'master'"Anthony Sottile2018-10-231-6/+3
| | | | | This reverts commit ba2fb9c53a8316642249598f599bbf7608d54260, reversing changes made to 63b91c95ea7795e3c3c90f2d643f685bfff312e9.
* Revert "Merge branch 'match_newlines_py3' into 'master'"Anthony Sottile2018-10-231-3/+6
| | | This reverts merge request !253
* Fix inconsistent newlines read from a file in python3Anthony Sottile2018-10-221-6/+3
|
* Use black to reformat Flake8Ian Stapleton Cordasco2018-10-201-53/+57
| | | | | Instead of just using Flake8 and pylint to keep Flake8 clean, let's also use black to make it less manual for clean-up.
* Only skip a file if `# flake8: noqa` is on a line by itselfAnthony Sottile2018-07-011-4/+12
|
* Simplify and speed up multiprocessingAnthony Sottile2016-11-291-0/+1
|
* 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 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 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.
* | Handle SyntaxErrors when tokenizing a fileIan Cordasco2016-08-061-7/+1
| | | | | | | | Closes #205
* | Merge branch 'bug/179' into 'master' Ian Cordasco2016-08-051-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Serialize Checkers PluginTypeManager to a dictIan Cordasco2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-1/+1
| | |
* | | 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.
* | Fix handling of logical lines with noqaIan Cordasco2016-07-261-6/+7
|/ | | | | | | | | | | When attempting to centralize all inline NoQA handling in the StyleGuide we inadvertently broke plugins relying on it in combination with checker state. For example, the check for E402 relies both on NoQA and the state to determine if it has seen a non-import line. Placing NoQA on the sole line that is not an import is more elegant than placing it on each of the following import lines. Closes #186
* Fix typo in documentation using `indect`Fabian Neundorf2016-07-211-1/+1
| | | | | | The documentation for the `FileProcessor` class used `indect_char` while the class itself uses the more sensible name `indent_char`. This updates both the docstring as well as the documentation.
* Fix up merge request 78Ian Cordasco2016-07-201-6/+5
| | | | | | | | This simplifies the changes, reduces the scope of refactors apparently for refactoring's sake and ensures that the internals are reasonable. It also airs on the side of preserving information rather than discarding or overwriting it.
* Propagate the stdin_display_name to checker and processorLeonardo Rochael Almeida2016-07-201-7/+10
| | | | This way plugins like flake8-putty can have access to the correct filename.
* Handle errors reported in empty filesIan Cordasco2016-07-091-1/+7
| | | | | | | | Some plugins (e.g., flake8-future-import) report errors for empty files. Those plugins default to reporting the line number as 1 which caused earlier versions of Flake8 3.0 beta to crash on an IndexError Closes #157
* Handle optional parameters that were never supportedIan Cordasco2016-06-281-3/+8
| | | | | | | | | | | | | | | | | Previously, pycodestyle never introspected the argument names for classes except to require that ``tree`` be an argument it could pass. For Flake8 3.0, we lifted that restriction, but old plugins seem to have cargo-culted their __init__ signature to be def __init__(self, tree, builtins=None): For some yet unknown reason. This was causing an AttributeError. By updating flake8.utils.parameters_for to return a dictionary that indicates whether the parameter is required or not, we can side-step this by simply ignoring the parameter if it has a default value and we cannot provide it. Closes #151
* Move flake8 into srcIan Cordasco2016-06-251-0/+430
This is an emerging best practice and there is little reason to not follow it