Commit graph

17 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
837e81948b communicate that --select is usually unnecessary 2022-12-14 12:55:37 -05:00
Anthony Sottile
e94fb10940 require python>=3.7 2022-08-05 19:51:08 -04:00
Anthony Sottile
367c810f0e don't consider default codes as explicitly selected unless listed 2022-06-24 17:55:41 -04:00
Anthony Sottile
c5225db626 simplify decision engine
- not specified codes (cmdline / config) are now known as being implicit via
  None sentinel
- removed redundant logic for (explicit, explicit) selection
2022-03-22 18:22:20 -07:00
Anthony Sottile
a8333e2bf2 move managing of off_by_default / enable_extensions to plugin loading 2022-01-01 18:33:07 -05:00
Ian Stapleton Cordasco
2bb0308363
Fix bug for plugins using extend_default_ignore
Since Flake8 3.0 we've had the ability for plugins to use
`extend_default_ignore` to register codes they want disabled by default.
This, however, was a permanent disabling unfortunately. Our code didn't
have a way of understanding that this new set of `ignore` codes was
actually the 'default' set for that run. Much like the
extended_select_list, we now attach extended_ignore_list to be able to
confidently determine if the ignore we get in the DecisionEngine is
actually the Default Ignore list and what plugins what us to ignore by
default.

Refs https://github.com/PyCQA/pep8-naming/pull/157
2021-04-15 13:26:08 -05:00
Frank Winklmeier
f98afbf7d9 Add --extend-select command line argument
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.
2021-04-11 20:40:53 +02:00
Anthony Sottile
b66ebd7034 move from optparse to argparse 2019-08-17 20:09:45 -07:00
Anthony Sottile
fb7e9338cd mypy now passes 2019-05-19 17:31:04 -07:00
Ville Skyttä
e8e35ea0ae Add some extend_ignores into decision engine test cases 2018-05-20 12:04:40 +02:00
Ville Skyttä
e520c2d936 Implement --extend-ignore
Refs #365
2018-05-16 08:50:26 +02:00
Ian Stapleton Cordasco
a44a09f87a
Remediate one wafer thing decision logic bug
Previously we were hitting the catch-all return that decided the error
was selected. Instead, let's add specific logic since we now know how we
would hit that and we actually don't want it to be selected.

Closes #354
2017-07-28 06:10:12 -05:00
Ian Cordasco
ff07ca3ed9
Add some better comments for decision logic 2017-06-04 15:07:10 -05:00
Ian Cordasco
e8c6a1e2f5
Get *one* more line of test coverage
This was mostly to prove to myself that we could possibly reach that
return more than actually covering that return. This just shows how
gnarly this logic actually is. I wish there were a better way to write
it.
2017-06-04 14:51:01 -05:00
Ian Cordasco
65107a5624
Rename methods on the new DecisionEngine
Rename `decision_for` to `more_specific_decision_for` and
`should_report_error` to `decision_for`.
2017-06-03 19:20:46 -05:00
Ian Cordasco
583fda7a70
Move unit tests for StyleGuide decision logic
Convert it to test the DecisionEngine class directly and put them in
their own file.
2017-06-02 19:16:28 -05:00