Commit graph

139 commits

Author SHA1 Message Date
Ian Cordasco
414922d08e Add documentation around the cli 2016-05-08 14:02:40 -05:00
Ian Cordasco
a82f8cb580 Print the total number of errors before exiting 2016-05-07 20:13:07 -05:00
Ian Cordasco
3ad798db61 Implement --exit-zero functionality 2016-05-07 19:34:27 -05:00
Ian Cordasco
d8635bb92a Simplify result handling
If we start collecting the results in run_parallel *immediately* after
starting the worker processes, we do not need another process to handle
the results. This also allows us to store all of the results on a the
FileChecker class and process results uniformly. This also means we can
count the number of errors and warnings in a run and use that to exit
appropriately (using SystemExit).
2016-05-07 19:28:54 -05:00
Ian Cordasco
e32476b671 Add test for the make_checkers method 2016-05-07 19:07:14 -05:00
Ian Cordasco
78b986d506 Refactor checker manager and add tests 2016-04-05 18:52:35 -05:00
Ian Cordasco
e3707bbe08 Fix multiprocessing work with retries 2016-04-02 14:02:43 -05:00
Ian Cordasco
09ad1d850e Restructure Checker Manager for serial retries 2016-04-02 11:30:12 -05:00
Ian Cordasco
425f89eee9 Add more tests around the processor module 2016-03-29 08:07:15 -05:00
Ian Cordasco
c11d33d917 Log the attribute error for developers 2016-03-26 08:51:50 -05:00
Ian Cordasco
48b995fa62 Remove unnecessary and outdated test runner 2016-03-17 14:55:57 -05:00
Ian Cordasco
ee18ac981e Handle case where file was ignored 2016-03-15 14:39:43 -05:00
Ian Cordasco
0b063a1024 Run checks expecting an AST 2016-03-15 14:11:01 -05:00
Ian Cordasco
576d1f6c85 Bypass linecache by recording physical line 2016-03-15 14:10:05 -05:00
Ian Cordasco
666e1c2b06 Ensure the logical line is tracked on the processor 2016-03-15 12:27:05 -05:00
Ian Cordasco
19062c5e9c Wrap up multiprocessing work 2016-03-15 12:18:45 -05:00
Ian Cordasco
c0659d1a8c Catch Keyboard interruptions in our application
Add logging to our main application
2016-03-15 11:53:12 -05:00
Ian Cordasco
67f9e04335 Only ever return an integer for job count 2016-03-15 11:52:19 -05:00
Ian Cordasco
6eb3dee1df Reorganize our Application flow 2016-03-15 08:42:30 -05:00
Ian Cordasco
189faf68ba Reorganize methods alphabetically
Add methods to report errors to the style guide

A single file works fine now but not a directory
2016-03-15 08:42:13 -05:00
Ian Cordasco
3b830366b6 Add a results queue 2016-03-15 08:40:43 -05:00
Ian Cordasco
07b9ffbeb9 Add naive multiprocessing support 2016-03-14 21:38:56 -05:00
Ian Cordasco
d222fcb9e1 Correct log levels around loading plugins 2016-03-14 21:38:08 -05:00
Ian Cordasco
0d3506b457 Log tokens at a lower level than debug 2016-03-14 21:37:50 -05:00
Ian Cordasco
e2314c38ed Add a lower level for extra verbosity 2016-03-14 21:37:32 -05:00
Ian Cordasco
447a6d4fcc Fix indentation causing incorrect logical lines 2016-03-14 20:23:20 -05:00
Ian Cordasco
daf5c4d80d Add ability to check if a file is ignored inline
Check for ``# flake8: noqa`` lines inside a file.
2016-03-14 20:23:03 -05:00
Ian Cordasco
2c17b4342f Better log format 2016-03-11 21:26:21 -06:00
Ian Cordasco
4c797c9ff7 Simplify how we check if a file is excluded
Our typical usage always passes is_path_excluded which checks the basename and the full path
2016-03-11 21:08:41 -06:00
Ian Cordasco
d331558868 Send logging output to --output-file 2016-03-11 21:07:40 -06:00
Ian Cordasco
960f4d6af7 Fix missing attributes for pep8 plugins 2016-03-10 19:54:53 -06:00
Ian Cordasco
da21821517 Make flake8 actually work 2016-03-10 19:00:07 -06:00
Ian Cordasco
36fb688f97 Refactor processor and file checker some more 2016-03-04 22:51:22 -06:00
Ian Cordasco
f7a8b7ade7 Move processor to its own module 2016-03-04 20:03:05 -06:00
Ian Cordasco
23c9091b1a Slowly working through pep8.Checker.check_logical 2016-03-02 23:28:24 -06:00
Ian Cordasco
0c894cc8bf Pull more logic out of pep8 2016-03-01 21:27:36 -06:00
Ian Cordasco
6ac955dfd4 Continue porting more logic from pep8 2016-02-28 00:55:47 -06:00
Ian Cordasco
074739de27 Accept the StyleGuide instead of options
pep8's checker has the noqa logic which we've correctly placed on the
StyleGuide object. By passing the StyleGuide in to our checkers we can
have the checkers pass the physical line to the StyleGuide so we can
eliminate our usage of linecache.
2016-02-27 00:06:19 -06:00
Ian Cordasco
12e71b0372 Incorporate more parsing logic from pycodestyle
Presently we're working on having two singly-responsible classes that
will be easy to test and ideally easier to reason about.
2016-02-26 23:16:33 -06:00
Ian Cordasco
b12f531da4 Separate the check runner from file processor
This separates concerns so that the check runner can rely on the file
processor to store state and such. It introduces two logical
collaborators and will allow us to keep feature parity with flake8 2's
plugin design (where it could request any attribute from pep8.Checker).
2016-02-26 08:52:20 -06:00
Ian Cordasco
6a15bd00b5 Store plugin parameters on the plugin itself
This allows us to access these from the checker module as well.
2016-02-26 08:21:09 -06:00
Ian Cordasco
8d36355611 Re-order project imports based on flake8-import-order 2016-02-25 11:14:41 -06:00
Ian Cordasco
a4e984dbd2 Add and fix documentation
- Add more documentation around utils functions
- Fix documentation about default formatting plugins
- Add extra documentation of filenames_from predicate parameter
- Add test for the default parameter of flake8.utils.fnmatch
2016-02-25 09:06:50 -06:00
Ian Cordasco
cd18b9f175 Constrain our search for plugin type
Flake8 has previously only ever relied on the first member of the
parameters list to determine what kind of check it is using. As such,
we constrain ourselves to just that parameter when checking and add
properties for ast and logical line checks.
2016-02-23 23:25:12 -06:00
Ian Cordasco
24d2689a05 Distinguish check types via plugin type manager
Flake8 and pep8 has historically supported three types of checks:

- Plugins that accept the physical line
- Plugins that accept the logical line
- Plugins that accept the AST tree

The logical place to make this distinction is on the Checkers plugin
type manager class. This adds the foundation for finding plugins that
fall into each class.
2016-02-23 23:20:34 -06:00
Ian Cordasco
1cd5fea730 Add type annotations 2016-02-23 21:09:19 -06:00
Ian Cordasco
5ee061b810 Add line splitting and file reading
Add some tests around reading lines and striping UTF BOMs
2016-02-23 11:17:11 -06:00
Ian Cordasco
28f4811cb9 Read lines from the file in our checker 2016-02-22 22:17:37 -06:00
Ian Cordasco
7addb72615 Add unified linters testenv 2016-02-22 21:59:59 -06:00
Ian Cordasco
d5a480a464 Add method to determine if filename is excluded
Add a method to make FileCheckers from the list of arguments the user
passes. Start to work on FileCheckers
2016-02-22 21:51:50 -06:00