Commit graph

96 commits

Author SHA1 Message Date
Ian Cordasco
84456866a5
Fix integration tests 2016-06-14 08:03:48 -05:00
Ian Cordasco
ba7f4db7e9
Add test fixture that mirrors documented usage 2016-06-07 18:46:58 -05:00
Ian Cordasco
4c0b1cd5e1
Fix tests broken by updating the default ignore list 2016-06-07 18:46:43 -05:00
Ian Cordasco
2cd3ac91d1
Start adding test fixture files
This adds E501 which is actually a poor test. Currently,
pep8.maximum_line_length does its own check for noqa instead of relying
on the Checker. See also: https://github.com/PyCQA/pycodestyle/pull/539
2016-06-07 18:03:58 -05:00
Ian Cordasco
9ebaa5c69c
Add tests for parse_unified_diff
We could probably use non-git diff fixtures, but those are what we have
for now.
2016-06-07 10:14:45 -05:00
Ian Cordasco
9ecca93a9b
Add more BaseFormatter subclass tests 2016-06-04 13:02:29 -05:00
Ian Cordasco
d477715064
Fix linting issues 2016-06-04 13:02:09 -05:00
Ian Cordasco
9c2e747528
Add tests around BaseFormatter#after_init 2016-06-04 12:39:11 -05:00
Ian Cordasco
ba2d94888c Add tests for BaseFormatter 2016-06-01 16:56:17 -05:00
Ian Cordasco
15043a4ab7 Update our linecache test to correct it 2016-05-30 16:48:30 -05:00
Ian Cordasco
467672fc5c Refactor Error formatting and handling
This allows us to handle --show-source in our formatters by default.

This also adds the physical line information to the Error class instead
of passing it to is_inline_ignored. This allows us to avoid using
linecache in our formatters.
2016-05-30 16:43:11 -05:00
Ian Cordasco
33f982b446 Rely on Python 3.4 backport of configparser
Python 2.7's ConfigParser module does not allow for the behaviour we
have documented for config files in Flake8 3.0. To compensate for that,
we add a dependency on the configparser backport on PyPI for Python 2.7
2016-05-30 12:51:31 -05:00
Ian Cordasco
466ef2e596 Add example configuration sections to the docs
Add tests to verify our examples do not regress
2016-05-28 12:00:47 -05:00
Ian Cordasco
91e07ebcff Refactor off-by-default plugins and enabling them
We move the logic to add or remove a plugin from the default ignore
list to individual methods on the Plugin class (Plugin#enable,
Plugin#disable) and use that when registering and parsing options.

If the plugin is off-by-default, Plugin#register_options will use
Plugin#disable. When parsing options via Plugin#provide_options, if
the plugin has been specified in --enable-extensions then it will be
re-enabled via Plugin#enable.
2016-05-28 11:57:18 -05:00
Ian Cordasco
559922dbbc Update tests after last night's refactor 2016-05-10 16:37:45 -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
Ian Cordasco
81eb3e41cc Add more processor tests 2016-04-02 11:13:23 -05:00
Ian Cordasco
425f89eee9 Add more tests around the processor module 2016-03-29 08:07:15 -05:00
Ian Cordasco
4ea161ff9c Add a few more unit tests around FileProcessor 2016-03-28 21:04:34 -05:00
Ian Cordasco
7de8a058dd Add unit test for build_ast 2016-03-28 19:43:14 -05:00
Ian Cordasco
698af80514 Add test for FileProcessor#split_line 2016-03-27 14:32:21 -05:00
Ian Cordasco
82dd4f6d25 Add more FileProcessor tests 2016-03-26 08:51:58 -05:00
Ian Cordasco
5554ef78cf Silence pytest warnings 2016-03-26 08:51:21 -05:00
Ian Cordasco
a4cc9d6fa8 Add test for reading from stdin with the file processor 2016-03-21 10:23:27 -05:00
Ian Cordasco
0fd276d5ee Add a test for FileProcessor.should_ignore_file 2016-03-17 15:16:15 -05:00
Ian Cordasco
5cde4bebae Add docstring for our test helper 2016-03-17 15:16:00 -05:00
Ian Cordasco
48b995fa62 Remove unnecessary and outdated test runner 2016-03-17 14:55:57 -05:00
Ian Cordasco
09000762fb Rename test file to mirror actual class it is testing 2016-03-17 09:15:52 -05:00
Ian Cordasco
de9f56addf Fix import ordering in test files 2016-02-25 14:41:37 -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
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
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
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
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
69b8be71dc Make pylint happier 2016-02-19 15:10:46 -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
a9a939cbbc Update StyleGuide tests and add new tests for handle_error 2016-02-15 22:31:56 -06:00
Ian Cordasco
eafc91ae6a Add handling and decision making for select and ignore 2016-02-02 20:48:26 -06:00
Ian Cordasco
0645ec3ef7 Move __contains__ and __getitem__ to proper class 2016-02-02 16:53:24 -06:00
Ian Cordasco
5dc7440a2b Start documenting our Trie implementation 2016-02-01 20:09:15 -06:00
Ian Cordasco
17a7826dc7 Add integration tests for aggregate_options 2016-01-24 22:14:36 -06:00
Ian Cordasco
2cba89c568 Log extended default values and add a test 2016-01-24 22:14:21 -06:00
Ian Cordasco
ebdc935ffc Refactor NotifierBuilder into its own mixin
This allows for easier unit testing
2016-01-24 15:13:58 -06:00
Ian Cordasco
b0a258fe79 Refactor our PluginTypeManager tests
Add tests for PluginTypeManager#{register,provide}_optoins
2016-01-23 23:02:06 -06:00