Commit graph

191 commits

Author SHA1 Message Date
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
f04d8da485 Add pep8 checks to plugins list 2016-03-10 19:41:19 -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
62a78f4a97 Add note to tox.ini for others 2016-02-25 14:43:52 -06:00
Ian Cordasco
de9f56addf Fix import ordering in test files 2016-02-25 14:41:37 -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
51d15295df Set the maximum complexity for mccabe 2016-02-23 17:08:54 -06:00
Ian Cordasco
08fd403e34 Add doc8 to linters 2016-02-23 14:42:50 -06:00
Ian Cordasco
54ad972e56 Add doc8 linting 2016-02-23 14:42:09 -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
Ian Cordasco
8792c30872 Add utility functions around filename matching
We add utils.fnmatch and utils.filenames_for in anticipation of our
checker manager creating file checkers for each file. We also include
tests for these functions and a couple previously untested utility
functions.
2016-02-22 21:47:43 -06:00
Ian Cordasco
a21c328870 Refactor our app setup/running a bit 2016-02-21 13:45:56 -06:00
Ian Cordasco
1312e4e0ef Add mypy env
There are still kinks to be worked out but this works reasonably well.
This will fail until we can figure out how to import things from the
typing module for the type: comments only. We do not want to add a
dependency on that backport only for this mypy env.
2016-02-21 13:09:44 -06:00
Ian Cordasco
1b91c8d66a Start working on the code that runs checks 2016-02-21 11:12:56 -06:00
Ian Cordasco
0c968f7a15 Add parity with `python -m flake8` 2016-02-19 19:38:27 -06:00
Ian Cordasco
aa6766861e Be consistent in setup.py 2016-02-19 18:59:48 -06:00
Ian Cordasco
8914ccd582 Configure logging based on --verbose 2016-02-19 18:59:38 -06:00
Ian Cordasco
8e2d8ec6f5 Update the default log format 2016-02-19 18:58:42 -06:00
Ian Cordasco
98357e71db Fix Notifier.listeners_for
If no Trie.find returns None, then node.data will return an
AttributeError.
2016-02-19 18:55:01 -06:00
Ian Cordasco
58b2ca69e4 Remove arguments from StyleGuide
- StyleGuides do not need the arguments passed in
- Add a test for is_inline_ignored obeying disable_noqa
2016-02-19 16:10:38 -06:00
Ian Cordasco
6d3d955ba9 Fix other tests after pylint fixes 2016-02-19 16:10:00 -06:00
Ian Cordasco
6c90e1045b Fix tests while keeping pylint happy 2016-02-19 16:07:28 -06:00
Ian Cordasco
0827df3e2a Fix our evaluation formula 2016-02-19 15:30:54 -06:00
Ian Cordasco
bda3124ffa Increase the confidence level for pylint to report something 2016-02-19 15:14:10 -06:00
Ian Cordasco
69b8be71dc Make pylint happier 2016-02-19 15:10:46 -06:00
Ian Cordasco
85c199ea34 Add pylint config and testenv 2016-02-19 15:10:17 -06:00
Ian Cordasco
fbd5944f15 Add specific tests for is_inline_ignored
Update the logic so someone can use a class in their ``# noqa`` ignore
list
2016-02-19 11:02:22 -06:00
Ian Cordasco
f4b18229a0 Add checking for inline #noqa comments
This also supports ignoring only specified codes
2016-02-19 09:08:24 -06:00