Commit graph

22 commits

Author SHA1 Message Date
Anthony Sottile
0d7247082e Merge branch 'master' into 'master'
Remove filter by filename in utils.filenames_from

Closes #382

See merge request pycqa/flake8!311
2019-07-08 20:11:25 +00:00
Anthony Sottile
fb7e9338cd mypy now passes 2019-05-19 17:31:04 -07:00
Yevhen Amelin
6fb49b2e80 Remove filter by filename in utils.filenames_from 2019-03-19 09:59:12 +02:00
Илья Лебедев
8e99b531cf FIX 507: allow multiple letters in codes 2019-02-11 17:00:34 +03:00
Anthony Sottile
f955a98b71 Improve error message for malformed per-file-ignores 2019-01-30 19:33:54 -08:00
Anthony Sottile
0c470a65d7 Allow capitalized filenames in per-file-ignores 2019-01-29 23:17:45 -08:00
Anthony Sottile
9788b87c91 Support more syntaxes in per-file-ignores 2019-01-07 19:35:41 -08:00
Ian Stapleton Cordasco
ec996ffd85
Allow spaces in # noqa lists
To match our new configuration file format and its allowance for spaces
in the list

Closes #356
2017-07-28 19:31:32 -05:00
Ian Cordasco
a42299d008
Support spaces as error/ignore code separators
Closes #329
2017-05-25 20:07:48 -05:00
Ian Cordasco
25566468a2
Filter out empty ignore/select codes
When we parse out our comma separated lists, we should ignore empty
strings to avoid them breaking users' expectations.

Closes #330
2017-05-20 20:26:27 -05:00
Anthony Sottile
0559e0b43c Don't apply excludes greedily to subdirs 2017-03-16 13:44:33 -07:00
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