summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Type annotate flake8.options.managerAnthony Sottile2019-09-074-102/+136
| | |
* | | Set configuration file-provided values via ArgumentParser.set_defaults()Eric N. Vander Weele2019-08-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling `ArgumentParser.parse_args()` with the `namespace` argument, command-line options are just added to the namespace without going through any of the argument parsing and type conversion logic (e.g., the `type` keyword argument of `ArgumentParser.add_argument()`). In other words, it is assumed that a namespace is well-formed from a previous invocation of `ArgumentParser.parse_args()`. The `values` parameter is intended to be values already-provided from configuration files. To take advantage of the logic defined by `ArgumentParser.add_argument()`, utilize `ArgumentParser.set_defaults()` instead.
* | | Add typing to `OptionManager.parse_args()`Eric N. Vander Weele2019-08-311-3/+11
| | | | | | | | | | | | | | | Note that the `assert` is necessary to "cast" `self.parser` since it is specified as a `Union`.
* | | Add typing to `OptionManager.parse_known_args()`Eric N. Vander Weele2019-08-301-3/+8
| | | | | | | | | | | | | | | Note that type casting is necessary given that `self.parser` is annotated as a `Union`.
* | | Remove unused parameter from `OptionManager.parse_known_args()`Eric N. Vander Weele2019-08-301-2/+2
| | | | | | | | | | | | | | | The `values` parameter is not utilized anywhere and can be safely removed.
* | | Add typings to ConfigFileFinder constructorEric N. Vander Weele2019-08-291-0/+1
|/ / | | | | | | | | `OptionManager.parse_known_args()` is guaranteed to return a list of remaining argument strings.
* | Hoist passing through sys.argv at the CLI layerEric N. Vander Weele2019-08-292-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `flake8.main.cli.main()` is the primary entry point for the command-line implementation of flake8 (invoked via `__main__` or `console_scripts`). Therefore, it is reasonable for the entry point to be responsible for obtaining command line arguments from `sys.argv` there. Note that `sys.argv[1:]` is necessary in order to strip off the script name. Formerly, this was not needed in `Application.parse_preliminary_options_and_args()`, which was using `sys.argv[:]` because the result of the argument parsing was just for determining additional configuration to be loaded. Then, the *real* CLI argument parsing was forwarding the original `None` value to `argparse.ArgumentParser.parse_args()`, which internally was obtaining arguments as `sys.argv[1:]`. Additionally, the contract for various argument parsing methods to be guaranteed a `List[str]`.
* | Put plugin options into separate argparse groupsAnthony Sottile2019-08-192-3/+17
| |
* | Apply suggestion to src/flake8/formatting/base.pyAnthony Sottile2019-08-181-1/+3
| |
* | move from optparse to argparseAnthony Sottile2019-08-1712-196/+262
| |
* | Fix --show-source when indented with tabsAnthony Sottile2019-08-101-2/+5
| |
* | Merge branch 'deprecate_setuptools_command' into 'master'Anthony Sottile2019-08-011-0/+8
|\ \ | | | | | | | | | | | | | | | | | | Deprecate the flake8 setuptools integration Closes #544 See merge request pycqa/flake8!330
| * | Deprecate the flake8 setuptools integrationAnthony Sottile2019-07-081-0/+8
| | |
* | | utils: Tighten `parse_comma_separated_list()` contract furtherEric N. Vander Weele2019-07-281-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that callers are ensuring that `value` is not `None`, we can further tighten the contract and remove the conditional to account when `None` is passed-in for `value`. Additionally, add a new test vector to account for when an empty string is passed in, which would fail `if no value`.
* | | Normalize option values additionally by typeEric N. Vander Weele2019-07-282-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the contract has narrowed for `utils.normalize_paths()` and `utils.parse_comma_separated_list()`, `Option.normalize()` must handle when the option value is either a singular value or a sequence (i.e., `list`) of values. The paths where `Option.normalize()` is called are: 1. options/config.py: `MergedConfigParser.parse_*_config()` There are 3 paths wehre eventually `_normalize_value()` is called. 2. options/manager.py: `OptionManager.parse_args()` For (1), values are coming from the `configparser` module. For (2), values are coming from `optparse.OptionParser`. Rudimentary investigation seems to implicate that `optparse.OptionParser.parse_args()` always returns values in a `list` because it accumulates values. However, for `configparser`, the values are a string due to the key-value nature of the INI format. Given that `Option.normalize()` is the convergence point where normalization of an option occurs, it is acceptable for the method to also handle the parsing comma-separated values and path normalization by the option value's type.
* | | utils: Change `normalize_paths()` contractEric N. Vander Weele2019-07-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `normalize_paths()` utility was doing too much — parsing unstructured configuration path data and dispatching the scrubbed paths to be normalized. Towards moving the parsing of unstructured configuration path data closer towards were configuration occurs, have the utility accept only structured input for normalizing paths.
* | | utils: Assert desired contract for `normalize_paths()`Eric N. Vander Weele2019-07-281-0/+1
| | | | | | | | | | | | | | | This is a separate commit so it can be dropped during a rebase or revert independently.
* | | utils: Change `parse_comma_separated_list()` contractEric N. Vander Weele2019-07-281-6/+4
| | | | | | | | | | | | | | | This is the initial incision point to only accept `str` (or `None`) for parsing out comma/whitespace/regexp separated values.
* | | utils: Assert desired contract for `parse_comma_separated_list()`Eric N. Vander Weele2019-07-281-0/+4
| | | | | | | | | | | | | | | This is a separate commit so it can be dropped during a rebase or reverted independently.
* | | Merge branch 'extra-config-normalization' into 'master'Anthony Sottile2019-07-232-9/+2
|\ \ \ | |/ / |/| | | | | | | | Push down extra config file path normalization into main config handling See merge request pycqa/flake8!333
| * | Push down extra config file path normalization into main config handlingEric N. Vander Weele2019-07-222-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | Move the path normalization for extra configuration file paths down into the main `config` module where other path normalization occurs. This also guarantees that the call to `utils.normalize_paths()` is given a sequence, instead of a potential `None` value.
* | | Fix / improve recently merged patches + CIAnthony Sottile2019-07-083-4/+4
| | |
* | | support extend-exclude Fixes #535Thomas Grainger2019-07-082-1/+16
| | |
* | | Merge branch 'master' into 'master'Anthony Sottile2019-07-081-3/+2
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Remove filter by filename in utils.filenames_from Closes #382 See merge request pycqa/flake8!311
| * | Remove filter by filename in utils.filenames_fromYevhen Amelin2019-03-191-3/+2
| | |
* | | Release 3.7.83.7.8Anthony Sottile2019-07-081-1/+1
| |/ |/|
* | pyflakes: Change to `normalize_path()` for filename normalizationEric N. Vander Weele2019-07-081-1/+1
| | | | | | | | | | | | | | It's unnecessary to call the `normalize_paths()` function because it is intended for dealing with multiple paths to normalize. Given that `normalize_paths()` utilizes `normalize_path()`, just call `normalize_path()` directly.
* | fix CI buildAnthony Sottile2019-07-081-2/+3
| |
* | This PR addresses issue #549 (noqa does only work as intended with single ↵Markus Piotrowski2019-06-161-1/+1
| | | | | | | | | | letter error codes). A single change in the regex `NOQA_INLINE_REGEXP` in `defaults.py` will allow to catch error codes which consist of more than one letter. This will close #549.
* | Merge branch 'show_traceback' into 'master'Anthony Sottile2019-06-141-1/+2
|\ \ | | | | | | | | | | | | Show traceback on plugin exception See merge request pycqa/flake8!317
| * | Show traceback on plugin exceptionIvan Pozdeev2019-05-201-1/+2
| | |
* | | mypy now passesAnthony Sottile2019-05-1918-175/+199
|/ /
* | whitelist a bandit false positive and improve type annotationAnthony Sottile2019-05-191-3/+3
| |
* | Fix crash when file fails to tokenize but parsesAnthony Sottile2019-04-071-2/+1
|/
* Fixes handling of empty lists by ApplicationCharles Frye2019-03-071-1/+1
| | | | | | | | | | | `Application.parse_preliminary_options_and_args` was previously, against expectations, treating empty lists passed as the `argv` argument the same way it treated `None`s. This has been addressed and the correct behavior tested for in a unit test of the `Application` class. See issue #518 for details.
* Release 3.7.73.7.7Anthony Sottile2019-02-251-1/+1
|
* Ensure exceptions are pickleableAnthony Sottile2019-02-192-27/+20
|
* Release 3.7.63.7.6Anthony Sottile2019-02-181-1/+1
|
* Merge branch 'mypy_improvements' into 'master'Ian Stapleton Cordasco2019-02-173-7/+8
|\ | | | | | | | | Improve a few mypy type annotations See merge request pycqa/flake8!307
| * Improve a few mypy type annotationsAnthony Sottile2019-02-173-7/+8
| |
* | Merge branch 'perf_only_one_proc' into 'master'Ian Stapleton Cordasco2019-02-171-9/+1
|\ \ | | | | | | | | | | | | Speed up flake8 when only 1 filename is passed See merge request pycqa/flake8!305
| * | Speed up flake8 when only 1 filename is passedAnthony Sottile2019-02-171-9/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ~40% improvement over status quo (perf measurements are best-of-5) ### before ```console $ time flake8 /dev/null real 0m0.337s user 0m0.212s sys 0m0.028s ``` ### after ```console $ time flake8 /dev/null real 0m0.197s user 0m0.182s sys 0m0.012s ```
* | Remove pyflakes monkeypatchingAnthony Sottile2019-02-161-11/+1
|/
* FIX 507: allow multiple letters in codesИлья Лебедев2019-02-111-1/+1
|
* Release 3.7.53.7.5Anthony Sottile2019-02-041-1/+1
|
* Fix reporting of UndefinedLocal pyflakes errorAnthony Sottile2019-01-311-5/+5
|
* Remove noqa comments now that 3.7 has been releasedAnthony Sottile2019-01-317-10/+9
|
* Release 3.7.43.7.4Anthony Sottile2019-01-311-1/+1
|
* Fix performance regression with per-file-ignoresAnthony Sottile2019-01-311-8/+6
| | | | | | | | With a large number of errors, filenames, and per-file-ignores the style guide selection would take a significant portion of execution time (python3 70% / python2 99.9%). Caching the styleguide lookup by filename eliminates this bottleneck.
* Release 3.7.33.7.3Anthony Sottile2019-01-301-1/+1
|