Commit graph

2506 commits

Author SHA1 Message Date
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
Ian Cordasco
533d222f52 Correct usage config_file StyleGuide parameter
Previously, we passed the location for our user config file to the
StyleGuide. This was intended to be a way to tell pep8's StyleGuide
to use that as a user config file, but instead that became the default
for the --config command-line option. This caused that to have higher
priority than the project configuration file.

Closes #122
2016-02-17 20:57:24 -06:00
Ian Cordasco
b25ad979a6 Merge branch 'bug/121' into 'master'
Update setuptools command option normalization

We were very naively "normalizing" options parsed and provided by
setuptools. This updates our handling to store the Option instance
from optparse so we can inspect the type, action, and option name for
more intelligent option normalization.

Closes #121

See merge request !52
2016-02-16 15:12:57 +00:00
Ian Cordasco
a9a939cbbc Update StyleGuide tests and add new tests for handle_error 2016-02-15 22:31:56 -06:00
Ian Cordasco
a8aac56092 Update setuptools command option normalization
We were very naively "normalizing" options parsed and provided by
setuptools. This updates our handling to store the Option instance
from optparse so we can inspect the type, action, and option name for
more intelligent option normalization.

Closes #121
2016-02-14 13:41:33 -06:00
Ian Cordasco
e2d6f33151 Fix AttributeError referring to enabled_extensions
Release v2.5.4
2016-02-11 11:53:44 -06:00
Ian Cordasco
1845ec33ec Bump version for 2.5.3 and update changes 2016-02-11 11:20:49 -06:00
Ian Cordasco
7d40f525f0 Definitely fix bug reading options from config files
Previously we were not reading output_file or enable_extensions from
user provided configuration files. The configuration option name
provided to config_options needs to be hyphenated in order for pep8 to
recognize and parse out the option correctly. Also, the destination name
needs to match the configuration option name that pep8 looks for
otherwise it will raise an unhandled KeyError exception.
2016-02-11 09:41:14 -06:00
Ian Cordasco
99b96e95ce Simplify StyleGuide and add handle_error method 2016-02-10 22:45:50 -06:00
Ian Cordasco
1d241a22c9 Sketch out how the StyleGuide would be used from main 2016-02-10 22:45:20 -06:00
Ian Cordasco
c20793b49c Add internal documentation around default formatters 2016-02-10 22:44:27 -06:00
Ian Cordasco
f824cbae93 Update docs index and tox env 2016-02-07 19:54:12 -06:00
Ian Cordasco
b8a38c2573 Add pylint formatter 2016-02-07 10:45:19 -06:00
Ian Cordasco
2fc853b772 Stop assigning output_fd in Default formatter 2016-02-07 10:44:46 -06:00
Ian Cordasco
0b8f11acc2 Fix our entry-points for report formatters 2016-02-07 09:40:32 -06:00
Ian Cordasco
853985e1dc Allow dictionary-like get behaviour with plugins 2016-02-07 09:40:18 -06:00
Ian Cordasco
57174a0743 Print the line not the output file object 2016-02-07 09:39:58 -06:00
Ian Cordasco
56976671d0 Fix entry-point names and example usage 2016-02-07 09:39:19 -06:00
Ian Cordasco
81495fd859 Add default formatting class 2016-02-06 15:22:36 -06:00
Ian Cordasco
7828b63002 Finish developer documentation around formatter plugins 2016-02-06 15:18:41 -06:00
Ian Cordasco
fe1b628c0f Add documentation around plugins and formatters 2016-02-06 14:36:44 -06:00
Ian Cordasco
63b50bc1f4 Add more functionality to the BaseFormatter
Ensure setuptools knows about flake8.formatting
2016-02-06 14:36:26 -06:00
Ian Cordasco
35bb32d94e Start working on default formatters for Flake8 2016-02-06 13:52:32 -06:00
Ian Cordasco
5870d136ed Represent an error with a namedtuple 2016-02-06 13:51:35 -06:00
Ian Cordasco
276f823de6 Add type annotations to flake8.utils for fun 2016-02-06 09:32:38 -06:00