Commit graph

28 commits

Author SHA1 Message Date
anthony sottile
4941a3e32e upgrade pyflakes / pycodestyle 2025-06-20 15:15:53 -04:00
Anthony Sottile
fa2ed7145c remove a few unnecessary mocks in test_checker_manager
noticed while implementing the --jobs limiter
2025-02-16 15:21:48 -05:00
Anthony Sottile
f35737a32d avoid starting unnecessary processes when file count is limited 2025-02-16 13:29:05 -05:00
Anthony Sottile
0d667a7329 enable multiprocessing on other platforms 2022-10-26 22:23:02 -07:00
Anthony Sottile
fba6df88f9 remove --diff option 2022-10-26 20:39:12 -07:00
Anthony Sottile
e94fb10940 require python>=3.7 2022-08-05 19:51:08 -04:00
Anthony Sottile
50d69150c1 rework plugin loading 2021-12-31 15:09:54 -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
66071563c2 split out file discovery and test it 2021-11-14 20:04:29 -08:00
Anthony Sottile
bb3c8d2607 improve coverage a bit 2021-11-14 09:39:33 -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
45573570cf Parse --jobs as a custom argparse type. Fixes #567 2020-05-13 13:25:51 -07:00
Anthony Sottile
93a17a806d instrument coverage on tests and require 100% coverage there 2020-03-23 12:15:29 -07: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
Thomas Grainger
9ba6677c4a support extend-exclude Fixes #535 2019-07-08 20:12:47 +00:00
Anthony Sottile
e8f43e1243 Speed up flake8 when only 1 filename is passed
~40% improvement over status quo (perf measurements are best-of-5)

### before

```console
$ time flake8 /dev/null

real    0m0.337s
user    0m0.212s
sys     0m0.028s
```

### after

```console
$ time flake8 /dev/null

real    0m0.197s
user    0m0.182s
sys     0m0.012s
```
2019-02-17 00:15:00 -08:00
Anthony Sottile
50e7cc71b9 Latest pycodestyle 2019-01-29 08:58:10 -08:00
Craig Silverstein
c16c0c9041 Do better testing that we actually call run_serial(). 2018-03-02 21:01:47 -08:00
Craig Silverstein
a5573fc864 Move all uses of pool inside run_parallel().
This includes creating the pool, tearing it down under normal use, and
tearing it down in case of exception.

Doing this makes it harder to leak processes, as for instance was
happening in #410.

Fixes #410
2018-03-02 20:49:31 -08:00
Anthony Sottile
109f5f8888 Simplify and speed up multiprocessing 2016-11-29 09:00:33 -08:00
Ian Cordasco
e14d0e6352
Serialize Checkers PluginTypeManager to a dict
It seems likely that the multiprocessing module on Windows is not
capable of serializing an object with the structure that we have and
preserving the attributes we dynamically set on plugins (like the
FlakesChecker). To avoid issues like this with all plugins (although
we have only found this on Windows with the FlakesChecker), let's try
serializing the Checkers PluginTypeManager to a dictionary so that the
only object that a Queue is really trying to serialize/deserialize is
the FlakesChecker itself.

Related to #179
2016-08-03 16:48:39 -05:00
Ian Cordasco
429d8a196e
Diable multiprocessing behaviour on Windows
Due to https://bugs.python.org/issue27649, we cannot continue to
expect multiprocessing to work as we expect and document it on Windows.
As such, we are going to revert back to our previous behaviour of
disabling it across all versions of Python on Windows to provide the
default expected behaviour of Flake8 on that Operating System.
2016-07-29 07:04:37 -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
e32476b671 Add test for the make_checkers method 2016-05-07 19:07:14 -05:00
Ian Cordasco
102037788d Fix import ordering 2016-04-05 18:54:28 -05:00
Ian Cordasco
78b986d506 Refactor checker manager and add tests 2016-04-05 18:52:35 -05:00
Ian Cordasco
eb3d8f5791 Add unit tests around serial retries 2016-04-03 14:41:12 -05:00