Commit graph

38 commits

Author SHA1 Message Date
Max R
5fab0d1887 Update hooks and use autopep8 + add-trailing-comma instead of black 2025-07-20 19:13:24 -04:00
Anthony Sottile
88457a0894 remove optparse support 2022-11-15 19:01:40 -05:00
Albert Tugushev
48b2919130 Display list of available formatters with help for --format 2022-10-15 15:39:05 -04:00
Anthony Sottile
e94fb10940 require python>=3.7 2022-08-05 19:51:08 -04:00
Anthony Sottile
f7ef1a6c8b make --ignore order consistent 2022-02-06 08:36:36 -08:00
Anthony Sottile
50d69150c1 rework plugin loading 2021-12-31 15:09:54 -08:00
Anthony Sottile
f98d52a398 have OptionManager take plugin versions directly 2021-12-08 15:49:17 -05:00
Anthony Sottile
8d3afe40e1 use return value of parse_args directly 2021-11-14 15:39:14 -08:00
Anthony Sottile
0698366a20 add a __repr__ for JobsArgument 2021-11-14 14:42:48 -08:00
Anthony Sottile
af1668bf04 extend black formatting to tests as well 2021-04-18 09:23:48 -07:00
Anthony Sottile
358ae85120 automatic: pyupgrade --py36-plus 2021-03-30 17:37:13 -07:00
Ruairidh MacLeod
9b8f908314 fix JobsArgument --help output 2020-06-05 14:25:57 +01:00
Ruairidh MacLeod
45573570cf Parse --jobs as a custom argparse type. Fixes #567 2020-05-13 13:25:51 -07:00
Anthony Sottile
3b490bb3c5 Fix type='str' optparse options 2020-04-24 10:43:54 -07: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
Anthony Sottile
8c4e42afaa Type annotate flake8.options.manager 2019-09-07 14:37:50 -07:00
Eric N. Vander Weele
aadd09dd8b Set configuration file-provided values via ArgumentParser.set_defaults()
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.
2019-08-31 00:10:46 -04:00
Eric N. Vander Weele
b231c10016 Test default provided options are forwarded
Ensure options provided external to the command-line (i.e.,
configuration files) are present in the final result of options.
2019-08-31 00:10:46 -04:00
Anthony Sottile
8fd36ba15b Put plugin options into separate argparse groups 2019-08-19 15:58:34 -07:00
Anthony Sottile
b66ebd7034 move from optparse to argparse 2019-08-17 20:09:45 -07:00
Ian Stapleton Cordasco
56b86ba9fe
Fix up test files for W504 2018-10-20 12:37:32 -05:00
Ian Stapleton Cordasco
156f90369f
Update our plugin registration for debugging
This allows us to report whether or not a plugin is local when users
provide `flake8 --bug-report` output.
2017-08-08 08:54:40 -05:00
Jon Dufresne
541bac6a82 Clean up some uses of set, list, and dict
* Use set literals instead of set([...])
* Avoid list(sorted(...)) as sorted returns a list
* Replace dict() with dict literal
2017-05-13 07:14:41 -07:00
Ian Cordasco
c9ea51aa45
Add test for reproducible --version strings
And add a release note to document the change.
2017-01-21 14:14:59 -06:00
Ian Cordasco
73be9b0e90
Add OptionManager#parse_known_args
If a user specified `--max-complexity` on the command-line, they
would be told that it did not exist. The same would be true of any
option provided by a plugin. This is because we parse the command-line
arguments twice in Flake8 -- the first time to specify the verbosity
and destination for logging, the second time to actually execute Flake8.
Since plugin options are not registered to start with the first time,
they are not valid options. So when we first parse the options, we should
only attempt to parse the ones which we know about.

Closes #168
2016-07-16 10:07:19 -05:00
Ian Cordasco
c9fb680dff
Add python and platform details to --version
On Flake8 2.x we added the information about the implementation,
version, and operating system to the --version output to make helping
users easier. In short they can pretty simply just give us the output
from

    flake8 --version

And we can get a lot of the information that we need.
2016-06-28 13:02:50 -05:00
Ian Cordasco
8bc76f79de
Configure flake8-import-order to use Google Style
This relies on two things:

1. Properly configuring flake8-import-order to use that style
2. Properly configuring flake8-import-order to know that flake8 is our
   application name.
2016-06-17 10:26:36 -05:00
Ian Cordasco
559922dbbc Update tests after last night's refactor 2016-05-10 16:37:45 -05:00
Ian Cordasco
de9f56addf Fix import ordering in test files 2016-02-25 14:41:37 -06:00
Ian Cordasco
2cba89c568 Log extended default values and add a test 2016-01-24 22:14:21 -06:00
Ian Cordasco
dcf696d678 Add tests around new OptionManager methods 2016-01-17 21:45:32 -06:00
Ian Cordasco
8c872c4bb9 Add more docstrings and fix lint errors 2016-01-10 14:47:06 -06:00
Ian Cordasco
9fe9ef06f7 Add test for comma-separated paths normalization 2016-01-09 21:20:20 -06:00
Ian Cordasco
cc3a9210fd Add more tests around parse_args 2016-01-09 21:15:03 -06:00
Ian Cordasco
13ca3dfe37 Show that even defaults are properly normalized 2016-01-09 20:30:28 -06:00
Ian Cordasco
ad0200e792 Add failing test for OptionManager.parse_args 2016-01-09 15:33:01 -06:00
Ian Cordasco
09bc9e2720 Add test for custom arguments to add_option 2016-01-09 15:22:22 -06:00
Ian Cordasco
a7ce4f00ec Start testing the OptionManager 2016-01-09 13:53:59 -06:00