Commit graph

11 commits

Author SHA1 Message Date
Ian Cordasco
2d3e277b1e
Handle optional parameters that were never supported
Previously, pycodestyle never introspected the argument names for
classes except to require that ``tree`` be an argument it could pass.
For Flake8 3.0, we lifted that restriction, but old plugins seem to
have cargo-culted their __init__ signature to be

    def __init__(self, tree, builtins=None):

For some yet unknown reason. This was causing an AttributeError. By
updating flake8.utils.parameters_for to return a dictionary that
indicates whether the parameter is required or not, we can side-step
this by simply ignoring the parameter if it has a default value and
we cannot provide it.

Closes #151
2016-06-28 09:36:24 -05:00
Ian Cordasco
1a2c68f5da
Move flake8 into src
This is an emerging best practice and there is little reason to not
follow it
2016-06-25 10:12:13 -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
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
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
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
8c872c4bb9 Add more docstrings and fix lint errors 2016-01-10 14:47:06 -06:00
Ian Cordasco
ec26d46dff Add tests for normalize_path and normalize_paths 2016-01-09 21:04:11 -06:00
Ian Cordasco
a4042d6d69 Start fleshing out flake8.utils
Add parse_comma_separated_list, normalize_path, and normalize_paths and
add logic in OptionManager.parse_args to use the right normalize_path*
function based on comma_separated_list value of the option.
2016-01-09 15:58:26 -06:00