Commit graph

1740 commits

Author SHA1 Message Date
Anthony Sottile
d99fd24ec5 Merge branch 'test_pypy' into 'master'
Test pypy in gitlab CI

See merge request pycqa/flake8!390
2019-11-29 18:30:15 +00:00
Anthony Sottile
8fdf262399 Test pypy in gitlab CI 2019-11-29 10:26:48 -08:00
Anthony Sottile
22f44c3d1a Merge branch 'workaround_pypy_repr_recursion_error' into 'master'
Work around RecursionError in EntryPoint.__repr__ in pypy

See merge request pycqa/flake8!389
2019-11-29 18:21:15 +00:00
Anthony Sottile
6b764d0ec7 Work around RecursionError in EntryPoint.__repr__ in pypy
https://gitlab.com/python-devs/importlib_metadata/issues/97
2019-11-29 10:17:29 -08:00
Anthony Sottile
5d7eeaa9b3 Merge branch 'importlib_metadata' into 'master'
Switch from entrypoints to importlib_metadata

Closes #569

See merge request pycqa/flake8!388
2019-11-29 17:40:55 +00:00
Anthony Sottile
d3c95f00d0 Switch from entrypoints to importlib_metadata 2019-11-28 17:30:52 -08:00
Anthony Sottile
15de413f9e Merge branch 'app-cleanup-docstrings' into 'master'
application: Update find_plugins() docstring

See merge request pycqa/flake8!387
2019-11-27 17:01:37 +00:00
Anthony Sottile
e891d5b00a Merge branch 'app-remove-local-plugin-attr' into 'master'
application: Remove local plugins state

See merge request pycqa/flake8!386
2019-11-27 17:00:24 +00:00
Eric N. Vander Weele
af9153d397 application: Update find_plugins() docstring
When the checks for the cached objects were removed in
2d5eae637a, the `.find_plugins()`
docstring need to be updated to specify the updated behavior.
2019-11-27 11:52:26 -05:00
Eric N. Vander Weele
131b063cb2 application: Remove local plugins state
The `.local_plugins` attribute can be removed from the `Application`
since the usage of the `LocalPlugins` object is isolated to the
`.find_plugins()` method.
2019-11-27 11:13:26 -05:00
Anthony Sottile
e571167161 Merge branch 'application-remove-config-finder-state' into 'master'
application: Remove configuration finder state

See merge request pycqa/flake8!384
2019-11-22 16:16:35 +00:00
Eric N. Vander Weele
594c16abb4 application: Remove configuration finder state
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.
2019-11-22 11:04:40 -05:00
Anthony Sottile
c9209507a8 Merge branch 'pytest-avoid-5.2.3' into 'master'
tox: Avoid installing pytest==5.2.3 due to an introduced regression

Closes #594

See merge request pycqa/flake8!383
2019-11-15 14:57:29 +00:00
Eric N. Vander Weele
03ee3644dd tox: Avoid installing pytest==5.2.3 due to an introduced regression
This will ensure that others don't git bitten by accidentally picking up
`pytest==5.2.3`.

See https://github.com/pytest-dev/pytest/issues/6194.
2019-11-15 20:53:03 +09:00
Anthony Sottile
e653ab8062 Merge branch 'app-make-config-side-effect-free' into 'master'
application: Change `make_config_finder` to be a pure static method

See merge request pycqa/flake8!378
2019-11-06 04:35:22 +00:00
Eric N. Vander Weele
d75088b199 application: Change make_config_finder to be a pure static method
This change makes `Application.make_config_finder` to be side-effect
free where it its return value is only determined by its input values.
2019-11-06 12:18:15 +08:00
Anthony Sottile
034f8823bc Merge branch 'app-remove-cached-objects' into 'master'
application: Remove checks for properties being set previously

See merge request pycqa/flake8!379
2019-11-05 13:43:45 +00:00
Anthony Sottile
02c6091b27 Merge branch 'py38' into 'master'
Cleanup CI and add python 3.8 support

See merge request pycqa/flake8!377
2019-11-05 13:41:41 +00:00
Djailla
f2a17ddf33 Cleanup CI and add python 3.8 support 2019-11-05 10:52:55 +01:00
Eric N. Vander Weele
2d5eae637a application: Remove checks for properties being set previously
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.
2019-11-05 15:32:51 +08:00
Anthony Sottile
19868e5c21 Merge branch 'aggregate_options-simplify-function-definition' into 'master'
aggregator: Simplify 'aggregate_options' function definition

See merge request pycqa/flake8!376
2019-11-03 01:11:43 +00:00
Eric N. Vander Weele
6c117cedd7 aggregator: Simplify 'aggregate_options' function definition
The `values` parameter is safe to remove since it is not provided as an
argument by any callers and the remaining arguments are guaranteed to
always be provided by all callers.
2019-11-03 01:11:43 +00:00
Anthony Sottile
ff871fe656 Merge branch 'application-argv-required-for-parsing' into 'master'
application: Make 'parse_configuration_and_cli' parameter required

See merge request pycqa/flake8!375
2019-11-03 01:10:34 +00:00
Anthony Sottile
f7f9c61108 Merge branch 'application-parse-prelim-opts' into 'master'
application: Rename prelim parsing method to 'parse_preliminary_options'

See merge request pycqa/flake8!374
2019-11-03 01:09:51 +00:00
Anthony Sottile
79c221a3e3 Merge branch 'application-make-config' into 'master'
application: Simplify creation of configuration file finder

See merge request pycqa/flake8!373
2019-11-03 01:09:08 +00:00
Eric N. Vander Weele
f8960020d0 application: Make 'parse_configuration_and_cli' parameter required
The remaining CLI arguments is now always provided as an argument this
method.
2019-11-03 01:35:25 +08:00
Eric N. Vander Weele
1abe1d42c2 application: Rename prelim parsing method to 'parse_preliminary_options'
Positional arguments are not used nor parsed for pre-configuration
loading.  Thus, renaming the method and updating the docstrings
appropriately.
2019-11-03 01:34:38 +08:00
Eric N. Vander Weele
3ac3349ef3 application: Simplify creation of configuration file finder
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.
2019-11-03 01:32:38 +08:00
Anthony Sottile
b5157e194d Merge branch 'black-19.10b0-reformat' into 'master'
Reformat with black >= 19.10b0

See merge request pycqa/flake8!372
2019-11-02 15:27:15 +00:00
Eric N. Vander Weele
80e05866fc Reformat with black >= 19.10b0
This resets the `black` formatting baseline so it doesn't get picked up
in future commits.
2019-11-01 21:26:12 -04:00
Anthony Sottile
b14d47b356 Merge branch 'separate-prelim-options' into 'master'
Separate pre-configuration CLI parsing

See merge request pycqa/flake8!364
2019-10-31 21:05:07 +00:00
Anthony Sottile
87acf9e5fc Merge branch '3.7-maintenance' into 'master'
Merge 3.7.9 tag and release notes

See merge request pycqa/flake8!369
2019-10-28 17:54:40 +00:00
Anthony Sottile
ee2920d775 Release 3.7.9 2019-10-28 10:34:54 -07:00
Anthony Sottile
182cdf6c23 Merge branch 'backport_pr_340' into '3.7-maintenance'
[3.7] Fix travis-ci

See merge request pycqa/flake8!368
2019-10-28 17:24:22 +00:00
Anthony Sottile
04d3f9dcaf Fix travis-ci 2019-10-28 10:19:39 -07:00
Anthony Sottile
ee740f4a92 Merge branch 'backport_pr_366' into '3.7-maintenance'
[3.7] Only use multiprocessing when the method is fork

See merge request pycqa/flake8!367
2019-10-28 17:06:25 +00:00
Anthony Sottile
04f49a7a77 Only use multiprocessing when the method is fork
In python3.8 on macos and in all versions on windows the multiprocessing
method is `spawn` which does not preserve class state.
2019-10-28 10:00:18 -07:00
Anthony Sottile
7441c63de8 Merge branch 'specific_noqa_pycodestyle' into 'master'
Do not pass `noqa` to plugins, have flake8 decide whether to report

Closes #552

See merge request pycqa/flake8!331
2019-10-28 16:51:09 +00:00
Anthony Sottile
6cc0abbea2 Merge branch 'only_fork' into 'master'
Only use multiprocessing when the method is fork

Closes #587

See merge request pycqa/flake8!366
2019-10-28 16:50:22 +00:00
Anthony Sottile
51f32bbe93 Only use multiprocessing when the method is fork
In python3.8 on macos and in all versions on windows the multiprocessing
method is `spawn` which does not preserve class state.
2019-10-28 09:43:30 -07:00
Anthony Sottile
d599950e6e Merge branch 'flake8-bugbear' into 'master'
linters: Add flake8-bugbear for finding bugs and design problems

See merge request pycqa/flake8!365
2019-10-25 21:22:11 +00:00
Eric N. Vander Weele
b42e758ac7 linters: Add flake8-bugbear for finding bugs and design problems
Also, make appropriate changes to satisfy issues flagged by
`flake8-bugbear`.
2019-10-25 17:11:30 -04:00
Eric N. Vander Weele
964b3a9c21 application: Forward remaining unknown arguments to final CLI parsing
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.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
4151ae0e53 application: Ensure --version is unknown during preliminary parsing
Now that the preliminary parser is being used, we can remove needing to
prune out `--version` and copying the original `argv` list.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
b9c8c3e118 application: Ensure -h/--help is unknown during preliminary parsing
Now that the preliminary parser is being used, we can remove needing to
prune out `-h` and `--help` from the copied `args` list.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
2260f5362e application: Keep unknown options in the unknown argument list
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.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
7f46990f4b application: Change to argparse.ArgumentParser for preliminary parsing
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.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
a90200353e application: Register preliminary options on a separate argument parser
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.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
1d7558f7da optmanager: Inherit options from parent argument parsers
Allow for including options from parent `argparse.ArgumentParser`
objects in preparation of splitting out the handling of preliminary
options from the `OptionManager`.
2019-10-25 17:07:43 -04:00
Eric N. Vander Weele
2a5c2bb696 options: Split-out registration of preliminary options
This is in preparation for having separate `ArgumentParser`s for
preliminary and the remaining options.
2019-10-25 17:07:43 -04:00