summaryrefslogtreecommitdiff
path: root/src/flake8/main
Commit message (Collapse)AuthorAgeFilesLines
* Update --indent-size help format stringJacob Hayes2021-08-011-1/+1
|
* Add --extend-select command line argumentFrank Winklmeier2021-04-111-0/+13
| | | | | | | | | Implement `--extend-select` command line argument following what was done for `--extend-ignore` in !233. This option can be used to selectively add individual codes without overriding the default list entirely. Addresses the remaining item of issue #1061.
* fix mypy errorsAnthony Sottile2021-04-071-8/+29
|
* audit + string joiningAnthony Sottile2021-03-301-2/+2
|
* com2annAnthony Sottile2021-03-304-45/+32
|
* clean up TYPE_CHECKING importsAnthony Sottile2021-03-301-3/+3
|
* automatic: pyupgrade --py36-plusAnthony Sottile2021-03-304-11/+15
|
* remove flake8 setuptools commandAnthony Sottile2021-03-291-115/+0
|
* remove vcs integrationAnthony Sottile2021-03-295-466/+0
|
* Add indent-size optionvalentin2021-03-141-0/+9
|
* Merge branch 'no_show_source' into 'master'Anthony Sottile2020-10-021-0/+7
|\ | | | | | | | | Add option to disable show-source for calling tools See merge request pycqa/flake8!441
| * Add option to disable show-source for calling toolsAnthony Sottile2020-06-191-0/+7
| |
* | fix a few small spelling issuesAnthony Sottile2020-09-202-2/+2
| | | | | | | | found via `pre-commit try-repo https://github.com/codespell-project/codespell --all-files`
* | upgrade black and run via pre-commitAnthony Sottile2020-08-271-2/+5
|/
* fix JobsArgument --help outputRuairidh MacLeod2020-06-051-0/+4
|
* treat --extend-exclude as a file listAnthony Sottile2020-05-211-0/+1
|
* Parse --jobs as a custom argparse type. Fixes #567Ruairidh MacLeod2020-05-131-0/+22
|
* options: Forward `--output-file` to be reparsed for BaseFormatterEric N. Vander Weele2020-05-111-1/+6
| | | | | | | | | This fixes a regression introduced in daca2c8 and b14d47b. The --output-file` option was consumed by the preliminary option parser. However, the `BaseFormatter` class needs the option for setting the output filename. This special cases this option to ensure it gets re-parsed and respected when specified on the CLI.
* Add deprecation message for git hookAnthony Sottile2020-04-271-0/+11
|
* Remove unused 'cli_config' parameterEric N. Vander Weele2020-01-121-13/+6
| | | | | | Now that `ConfigFileFinder.config_file` attribute is used everywhere and is constructed from the `--config` CLI option, the now unused `cli_config` parameters can be safely removed.
* config: Add 'config_file' parameter to ConfigFileFinderEric N. Vander Weele2020-01-121-0/+1
| | | | | | | | | The `--config` flag is passed into `MergedConfigParser.parse()` and the module-level function `config.get_local_plugins()`. Since both of these places utilize the `ConfigFileFinder` object and the configuration file override pertains to how configuration behaves, this incremental change directly associates the `ConfigFileFinder` and the configuration file override.
* application: Remove stale docstring param for `.find_plugins()`Eric N. Vander Weele2020-01-121-3/+0
| | | | | The 'ignore_config_files' parameter was accidentally not removed in c918e72.
* Remove unused 'isolated' parameterEric N. Vander Weele2020-01-071-21/+6
| | | | | | Now that `ConfigFileFinder.ignore_config_files` attribute is used everywhere and is constructed from the `--isolated` CLI option, the now unused `isolated` parameters can be safely removed.
* config: Add 'ignore_config_files' parameter to ConfigFileFinderEric N. Vander Weele2020-01-071-1/+3
| | | | | | | | | The `--isolated` flag is passed into `MergedConfigParser.parse()` and the module-level function `config.get_local_plugins()`. Since both of these places utilize the `ConfigFileFinder` object and isolation pertains to how the `ConfigFileFinder` should behave with respect to isolation, this incremental change more directly associates the `ConfigFileFinder` and configuration file isolate.
* aggregator: Forward --config and --isolated options during aggregationEric N. Vander Weele2019-12-291-4/+25
| | | | | | | | | | | | | | This fixes a regression introduced in !346 to ensure that `--config` and `--isolated` are recognized in `aggregate_options()`. The regression manifested because `aggregate_options()` was relying on re-parsing `argv` to obtain the option values. However, !346 changed the preliminary parsing logic to only parse and "eat" what is necessary and forward along the options needed before all the configuration was loaded. This code path was overlooked because the tests in `test_aggregator()` were passing but the call from the `Application` object would never have these options in the remaining `argv` list to be passed long.
* application: Inline creation of config.ConfigFileFinderEric N. Vander Weele2019-12-031-18/+1
| | | | | | 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 typosBrian Wignall2019-12-021-2/+2
|
* Merge branch 'fix/exit-zero' into 'master'Anthony Sottile2019-12-021-1/+3
|\ | | | | | | | | Fix --exit-zero when --diff is empty See merge request pycqa/flake8!391
| * Fixes --exit-zero when empty --diffKinya TERASAKA2019-12-021-1/+3
| | | | | | | | fixes pycqa/flake8/merge_requests!137
* | Switch from entrypoints to importlib_metadataAnthony Sottile2019-11-282-7/+4
|/
* Merge branch 'app-cleanup-docstrings' into 'master'Anthony Sottile2019-11-271-5/+2
|\ | | | | | | | | application: Update find_plugins() docstring See merge request pycqa/flake8!387
| * application: Update find_plugins() docstringEric N. Vander Weele2019-11-271-5/+2
| | | | | | | | | | | | When the checks for the cached objects were removed in 2d5eae637a0738d4bad62bed36b57fef07682df6, the `.find_plugins()` docstring need to be updated to specify the updated behavior.
* | application: Remove local plugins stateEric N. Vander Weele2019-11-271-6/+4
|/ | | | | | The `.local_plugins` attribute can be removed from the `Application` since the usage of the `LocalPlugins` object is isolated to the `.find_plugins()` method.
* application: Remove configuration finder stateEric N. Vander Weele2019-11-221-11/+15
| | | | | | | This change removes the `.config_finder` object from the `Application`. Since the configuration finder is only needed during initialization, we constrain the finder to be returned and passed to other methods necessary for initialization.
* Merge branch 'app-make-config-side-effect-free' into 'master'Anthony Sottile2019-11-061-6/+13
|\ | | | | | | | | application: Change `make_config_finder` to be a pure static method See merge request pycqa/flake8!378
| * application: Change `make_config_finder` to be a pure static methodEric N. Vander Weele2019-11-061-6/+13
| | | | | | | | | | This change makes `Application.make_config_finder` to be side-effect free where it its return value is only determined by its input values.
* | application: Remove checks for properties being set previouslyEric N. Vander Weele2019-11-051-35/+28
|/ | | | | | Remove the checks to see an object was already created before creating or obtaining it. This is not necessary as each entire run of `flake8` calls these methods *only* once.
* Merge branch 'application-argv-required-for-parsing' into 'master'Anthony Sottile2019-11-031-2/+2
|\ | | | | | | | | application: Make 'parse_configuration_and_cli' parameter required See merge request pycqa/flake8!375
| * application: Make 'parse_configuration_and_cli' parameter requiredEric N. Vander Weele2019-11-031-2/+2
| | | | | | | | | | The remaining CLI arguments is now always provided as an argument this method.
* | Merge branch 'application-parse-prelim-opts' into 'master'Anthony Sottile2019-11-031-7/+5
|\ \ | | | | | | | | | | | | application: Rename prelim parsing method to 'parse_preliminary_options' See merge request pycqa/flake8!374
| * | application: Rename prelim parsing method to 'parse_preliminary_options'Eric N. Vander Weele2019-11-031-7/+5
| |/ | | | | | | | | | | Positional arguments are not used nor parsed for pre-configuration loading. Thus, renaming the method and updating the docstrings appropriately.
* | application: Simplify creation of configuration file finderEric N. Vander Weele2019-11-031-8/+8
|/ | | | | | | | | | | | | | | | | This commit simplifies and updates the method for handling the creation of the configuration file finder. The main takeaways are: - Renaming the parameter (i.e., `extra_config_files`) to be a noun to better describe the input versus what the option name was called. - Refreshed the docstring to align with changes from previous commits and this one. - Remove the check to see if it a configuration file finder was already created. This is not necessary as each entire run of a `flake8` calls this method once. When the programmatic API is provided, configuration would be provided 'in-code' and not rely upon external files/resources. - Use directly the program name from the `Application`, itself since this is the authoritative source for defining it.
* application: Forward remaining unknown arguments to final CLI parsingEric N. Vander Weele2019-10-251-2/+2
| | | | | | | | Now that `parse_preliminary_options_and_args()` ignores unknown options and arguments, forward the remaining unknown arguments to the main CLI and configuration method to be consumed. This prevents re-parsing the entire `argv` list again by forwarding the remaining arguments left to be consumed.
* application: Ensure `--version` is unknown during preliminary parsingEric N. Vander Weele2019-10-251-15/+1
| | | | | Now that the preliminary parser is being used, we can remove needing to prune out `--version` and copying the original `argv` list.
* application: Ensure `-h/--help` is unknown during preliminary parsingEric N. Vander Weele2019-10-251-8/+0
| | | | | Now that the preliminary parser is being used, we can remove needing to prune out `-h` and `--help` from the copied `args` list.
* application: Keep unknown options in the unknown argument listEric N. Vander Weele2019-10-251-4/+1
| | | | | | | Positional arguments aren't necessary for determining where to load configuration anymore and is safe to keep both options and arguments to be forwarded for later parsing after configuration is loaded.
* application: Change to `argparse.ArgumentParser` for preliminary parsingEric N. Vander Weele2019-10-251-1/+1
| | | | | | | | | | | | Now that preliminary options are registered with the preliminary parser on the `Application`, leverage that for parsing known options. This important change removes the `Application.option_manager` from being responsible for pre-configuration parsing and the workarounds needed in the `Application.parse_preliminary_options_and_args()` to account for the fact that `Application.option_manager` was aware of *all* options, not just the options necessary for pre-configuration loading. A following commit will address removing these workarounds.
* application: Register preliminary options on a separate argument parserEric N. Vander Weele2019-10-252-9/+16
| | | | | | | | | | We introduce a new `ArgumentParser` for registering the preliminary options to be inherited by the `Application.option_manager`. The next step will be to use the `Application.prelim_arg_parser` for parsing and handling preliminary options and arguments. Note that we prevent the preliminary parser from handling `-h/--help` and defer to that to the primary parser.
* options: Split-out registration of preliminary optionsEric N. Vander Weele2019-10-252-44/+55
| | | | | This is in preparation for having separate `ArgumentParser`s for preliminary and the remaining options.
* application: Remove forwarding unused preliminary argumentsEric N. Vander Weele2019-10-131-5/+3
| | | | | | The `ConfigFileFinder` doesn't utilize the preliminary arguments (i.e., the file names) anymore for computing the starting path for the configuration file search.