Commit graph

413 commits

Author SHA1 Message Date
Ruairidh MacLeod
d948169292 add check for a missing specified config file 2021-12-24 23:40:31 +00:00
Ruairidh MacLeod
d478d92299 add failing test for missing config file 2021-12-24 23:40:31 +00:00
Anthony Sottile
a7be5e798b fix AttributeError when catatstrophic failure is triggered 2021-12-24 16:38:17 -05:00
Anthony Sottile
f98d52a398 have OptionManager take plugin versions directly 2021-12-08 15:49:17 -05:00
Anthony Sottile
1e4743d490 use plugin_name= instead of dicts in exceptions 2021-12-07 15:36:20 -08:00
Anthony Sottile
52fb518104 eliminate --bug-report double-parse quirk with store_true 2021-12-07 13:49:57 -08:00
Anthony Sottile
fa8ac82ee2 add integration test for off_by_default plugin 2021-12-07 12:25:24 -08:00
Anthony Sottile
77a054688b refactor run_checks to not take an Optional list of filenames 2021-11-25 15:45:01 -05:00
Anthony Sottile
65c893728e refactor and simplify configuration loading 2021-11-22 19:45:17 -05:00
Anthony Sottile
411ff24392 move from allowlist to blocklist for mypy 2021-11-14 21:48:17 -08:00
Anthony Sottile
3b7dbd6697 replace py2-kwonly shim with true kwonly args 2021-11-14 20:59:28 -08:00
Anthony Sottile
bbbe0d8048 improve integration tests 2021-11-14 20:39:45 -08:00
Anthony Sottile
66071563c2 split out file discovery and test it 2021-11-14 20:04:29 -08:00
Anthony Sottile
97c3de41bd fix test name after exit -> exit_code refactor 2021-11-14 16:38:39 -08:00
Anthony Sottile
81a4110338 have application return exit code for easier testing 2021-11-14 16:29:18 -08: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
bb3c8d2607 improve coverage a bit 2021-11-14 09:39:33 -08:00
Anthony Sottile
3af47b7df5 remove some unused test fixture files 2021-11-14 08:54:57 -08:00
Anthony Sottile
17822984a5
Merge pull request #1454 from asottile/unused-example-code
remove unused example-code test fixtures
2021-11-14 11:45:25 -05:00
Anthony Sottile
b3c6364f0e remove unused example-code test fixtures 2021-11-14 08:42:35 -08:00
Anthony Sottile
0c62569c4f remove dead code
detected using https://github.com/asottile/dead
2021-11-14 08:40:34 -08:00
Anthony Sottile
848003cc05 add --color option 2021-11-05 20:37:08 -04:00
Max R
dd6d61c9a6 Fix tests 2021-10-17 22:13:11 -04:00
Ian Stapleton Cordasco
807904aebc
Drop support for Home and XDG config files
This has been a huge support burden for us. I seriously considered doing
this in 3.0 but caved to a vocal minority and the desire to keep as much
backwards compatibility as possible. At this point, however, I'm done
witnessing the abuse Anthony has to suffer over this and I'm done with
the undue hostility that people who don't bother to read the docs
display. Hopefully, this eases that a bit.
2021-10-10 19:18:51 -05:00
Anthony Sottile
a46b61901e fix test name after refactor 2021-09-08 18:49:11 -04:00
Anthony Sottile
7a353d2e23 write directly to sys.stdout.buffer to avoid windows io encoding 2021-09-08 17:10:04 -04:00
Anthony Sottile
d34581b83f test using python3.10 2021-08-15 19:00:43 -04:00
Ian Stapleton Cordasco
85c2be3b52 Handle new SyntaxError tuple on 3.10
Closes #1372
2021-08-15 18:26:27 -04:00
Jouke Witteveen
efc15cf4f1 Automatically create output directories 2021-05-10 16:41:01 +02:00
Anthony Sottile
456e98486e short circuit on ast error before tokenization error 2021-04-18 10:08:11 -07:00
Anthony Sottile
af1668bf04 extend black formatting to tests as well 2021-04-18 09:23:48 -07: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
737e0492d0 improve code coverage in a few places 2021-04-07 08:52:26 -07:00
Anthony Sottile
3f10c04fd0 fix mypy errors 2021-04-07 08:28:11 -07:00
Anthony Sottile
3b57778160 fix links in code 2021-04-03 18:21:02 -07:00
Anthony Sottile
edadccd8dc audit + string joining 2021-03-30 17:37:13 -07:00
Anthony Sottile
5d43462c9d clean up version_info references 2021-03-30 17:37:13 -07:00
Anthony Sottile
358ae85120 automatic: pyupgrade --py36-plus 2021-03-30 17:37:13 -07:00
Anthony Sottile
55f29c636f introduce pyupgrade, run it in python2-compatible mode 2021-03-29 20:21:36 -07:00
Anthony Sottile
83fc824ca1 remove flake8 setuptools command 2021-03-29 20:15:45 -07:00
Anthony Sottile
1a1d850e99 remove vcs integration 2021-03-29 19:01:59 -07:00
Anthony Sottile
40aba49d0d upgrade pycodestyle to 2.7.0 2021-03-14 11:58:03 -07:00
Anthony Sottile
0bf8d2a885 ensure crlf line endings of stdin are handled properly 2021-01-07 09:15:46 -08:00
Anthony Sottile
14857c98e0 fix test which was not testing anything 2021-01-07 08:57:13 -08:00
Anthony Sottile
0efbb5dbcb Merge branch 'no_show_source' into 'master'
Add option to disable show-source for calling tools

See merge request pycqa/flake8!441
2020-10-02 23:40:04 +00:00
Anthony Sottile
2fe70dda6b fix a few small spelling issues
found via `pre-commit try-repo https://github.com/codespell-project/codespell --all-files`
2020-09-20 19:16:10 -07:00
Anthony Sottile
ee9c2874a9 fix skipping of physical checks when file does not end in newline 2020-09-12 12:03:23 -07:00
Nekokatt
e6a5f6a663 Support linting when missing sem_open syscall
Platforms such as Termux on Android, and other exotic devices
do not provide a sem_open implementation on the OS level. This
is problematic, as the error resulting from this occurs when
calling multiprocessing.Pool, throwing an unhandled ImportError.

The issue itself is outlined in https://bugs.python.org/issue3770.

This change allows devices missing this system call to respond
to the missing feature by falling back to synchronous execution,
which appears to be the default behaviour if the multiprocessing
module is not found.

This change also adds a potential fix for developers working
on platforms where multiprocessing itself cannot be imported.
The existing code would set the name referencing the import to
None, but there are no clear checks to ensure this does not
result in an AttributeError later when multiprocessing.Pool
has accession attempts.

Existing users should see no difference in functionality, as they
will assumably already be able to use flake8, so will not be
missing this sem_open call.

Users on devices without the sem_open call will now be able
to use flake8 where they would be unable to before due to
unhandled ImportErrors.
2020-08-27 15:41:25 -07:00