| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
Closes #205
|
| |\
| |
| |
| |
| |
| |
| |
| |
| | |
Set version to 3.0.4 and start release notes
*Description of changes*
Start tracking release notes for 3.0.4
See merge request !113
|
| | | |
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
Serialize Checkers PluginTypeManager to a dict
*Description of changes*
Try to side-step issues with attributes not being set/updated on plugins when used with multiprocessing and Queues.
*Related to:* #179, #164
See merge request !98
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It seems likely that the multiprocessing module on Windows is not
capable of serializing an object with the structure that we have and
preserving the attributes we dynamically set on plugins (like the
FlakesChecker). To avoid issues like this with all plugins (although
we have only found this on Windows with the FlakesChecker), let's try
serializing the Checkers PluginTypeManager to a dictionary so that the
only object that a Queue is really trying to serialize/deserialize is
the FlakesChecker itself.
Related to #179
|
| | | |
|
| | |
| |
| |
| |
| | |
...and avoid .strerror altogether since py3 does not have it.
See #203.
|
| |/
|
|
|
| |
...since on py3 tokenize.TokenError does not have a 'message' attribute.
See #203.
|
| |
|
|
| |
Update release date as well
|
| |
|
|
|
|
|
| |
For our Legacy API users, StyleGuide.init_report should reset the
formatter attribute before calling Application.make_formatter().
Closes #200
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, all testing was done from the directory in which the
configuration file lived, so this bug went unnoticed. However, if you
run Flake8 against its own source from a directory above, you would
notice that the patterns in the exclude config value in tox.ini were
ignored. This is because we (like any reasonable person) are using
relative paths. The path is relative, however, to the directory in
which the configuration file was located. So we keep track of which
directory that is and use that to normalize the paths in the config
file.
Yes, there is an unrelated change to our tox.ini in this commit as
well. ;-)
Closes #194
|
| |
|
|
|
|
|
| |
This avoid overwriting portions of our log output when using Flake8
in verbose mode.
Closes #193
|
| |
|
|
| |
Closes #199
|
| |
|
|
|
|
|
|
| |
Due to https://bugs.python.org/issue27649, we cannot continue to
expect multiprocessing to work as we expect and document it on Windows.
As such, we are going to revert back to our previous behaviour of
disabling it across all versions of Python on Windows to provide the
default expected behaviour of Flake8 on that Operating System.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, to ensure that plugins on by default were reported, we
added them to the select list. This means that ignoring them became
impossible. To accomodate our reporting logic and a user's ability
to ignore, we need to keep our select and extended select lists
separated.
This allows us to have a better understanding of who is selecting what,
where, and how and make our decision as to whether or not an error
should be reported more wisely.
Closes #195
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
E.g.:
```
$ .tox/flake8/bin/flake8 mobileweb
Traceback (most recent call last):
File ".tox/flake8/bin/flake8", line 9, in <module>
load_entry_point('flake8', 'console_scripts', 'flake8')()
File "/Users/marca/dev/git-repos/flake8/src/flake8/main/cli.py", line 16, in main
app.run(argv)
File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 316, in run
self._run(argv)
File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 299, in _run
self.initialize(argv)
File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 289, in initialize
self.find_plugins()
File "/Users/marca/dev/git-repos/flake8/src/flake8/main/application.py", line 143, in find_plugins
self.check_plugins.load_plugins()
File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 375, in load_plugins
plugins = list(self.manager.map(load_plugin))
File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 267, in map
yield func(self.plugins[name], *args, **kwargs)
File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 373, in load_plugin
return plugin.load_plugin()
File "/Users/marca/dev/git-repos/flake8/src/flake8/plugins/manager.py", line 173, in load_plugin
raise failed_to_load
flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "P999" due to Plugin <module 'teamcity.flake8_plugin' from '/Users/marca/dev/git-repos/teamcity-messages/teamcity/flake8_plugin.pyc'> is not a callable. It might be written for an older version of flake8 and might not work with this version.
```
This is nicer than the previous behavior of raising an obscure `PicklingError` and then hanging.
```
$ .tox/flake8/bin/flake8 mobileweb
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 268, in _feed
send(obj)
PicklingError: Can't pickle <type 'module'>: attribute lookup __builtin__.module failed
```
See #164
|
| |
|
|
|
|
|
| |
Originally the reports have been sorted by column and message (without the
error code), so it didn't order after the line number.
Closes #196
|
| |
|
|
|
|
|
|
| |
This makes the regular expression a bit more complex, and potentially
slower, but it will fix the issue where users had noqa comments with
colons followed by explanations.
Closes #178
|
| |
|
|
|
|
|
|
|
| |
Plugins do not have their parameters checked in advance, so when we
try to aggregate parameters for a plugin, there's a chance it may
request an attribute of the FileProcessor that simply does not exist.
We catch this and re-raise it but we should also capture it in the
checker manager and handle it appropriately there as well.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix multiprocessing on Windows
*Related to:* #184
I'm still running into #179 with this fix but all processes start now at least.
BTW the current design is pretty bad regarding memory footprint and bootstrap time as you have to pickle the manager object for *every* subprocess. So this does not only fix multiprocessing on Windows. It improves the multiprocessing design on other platforms, too.
See merge request !97
|
| | | |
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
_job_count always returns an int
Trivial change, but `_job_count` always returns an `int`.
See merge request !95
|
| | | |
|
| | |
| |
| |
| |
| | |
As FichteFoll pointed out on IRC, this line could include Python 3s
less than 3.2 as well.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When attempting to centralize all inline NoQA handling in the StyleGuide
we inadvertently broke plugins relying on it in combination with checker
state. For example, the check for E402 relies both on NoQA and the state
to determine if it has seen a non-import line. Placing NoQA on the sole
line that is not an import is more elegant than placing it on each of
the following import lines.
Closes #186
|
| |/
|
|
|
| |
We accidentally changed column numbering from one-indexed to
zero-indexed.
|
| |
|
|
|
|
|
|
|
| |
Flake8 3.0 was stopping once it found the current directory but the
historical behaviour (that we didn't intend to break) searched past
that (towards root) until it found one of the project/local config
file names that could be read.
Closes #181
|
| |
|
|
|
|
| |
This allows for other text after `# noqa`.
Related to #180
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Handle repeated --quiet options again
*Description of changes*
Handle `-q`/`--quiet` again.
*Related to:* #180
See merge request !89
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fundamentally on Flake8 2.x using -q altered the format of the errors
(and the behaviour a little) so it makes the most sense to implement
this logic with formatters rather than messy logic spread throughout
the project.
The FilenameOnly formatter will keep track of filenames already reported
and only print the name once while Nothing will print nothing.
Closes #180
|
| |\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Wire-up --statistics again
*Description of changes*
Make `--statistics` work again
*Related to:* #180
See merge request !87
|
| | |
| |
| |
| |
| |
| |
| | |
I'm not sure where this code went or when, but it disappeared. Let's
add it back.
Related #180
|
| |/
|
|
|
|
|
| |
Without calling start and stop, our output file is not used by our
Formatters and any formatting plugins.
Related #180
|
| |
|
|
|
|
|
|
|
| |
In Flake8 2.x we allowed people to use # noqa at the end of a multiline
string to ignore errors inside the string (e.g., E501). Being blissfully
ignorant of this, I never accounted for it in Flake8 3. This fixes the
oversight and allows multiline statements to have the # noqa at the end.
Closes #177
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
It is possible to write plugins which are only a function. At the moment they
are called on each line manually. This allows the function also to be called
on each file once. It works similar to creating the class and calling `run` on
it immediately. The plugin function needs to return a generator.
This is based on the original comment in the `FileChecker.run_ast_checks`
method, but slightly modified as the original comment would've called the
return of the function. But the function could return the reports directly.
|
| |
|
|
|
|
|
| |
In the case where alternate separator is None, we use '' which will
always be in any string. We want to skip that case.
Also we only run our tests on AppVeyor, not all of our testenvs.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When normalizing paths, we want to handle the following cases:
- Someone is using a Windows-style path on Windows
- Someone is using a Unix style path on Unix
- Someone is using a Unix style path on Windows
os.path.sep will handle the native directory separator character while
os.path.altsep (when set) will handle alternate separators. Further,
os.path.abspath does the right thing on Windows when handed a Unix-style
path.
Related to #175
|
| |
|
|
|
|
| |
The documentation for the `FileProcessor` class used `indect_char` while the
class itself uses the more sensible name `indent_char`. This updates both the
docstring as well as the documentation.
|
| |
|
|
|
|
|
|
| |
This simplifies the changes, reduces the scope of refactors apparently
for refactoring's sake and ensures that the internals are reasonable.
It also airs on the side of preserving information rather than
discarding or overwriting it.
|
| |
|
|
| |
This way plugins like flake8-putty can have access to the correct filename.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the sake of IDEs, check filename for exclusion even if the file is directly
named in the command line.
Also, if the filename is "-" (stdin) check the provided display name for
exclusion.
Also, avoid calling path checking functions on the "-" filename:
* fnmatch.fnmatch()
* os.path.isdir()
* os.path.exists()
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add Legacy API unit tests
*Description of changes*
Add unit tests around the legacy API.
*Related to:* n/a
See merge request !76
|
| | | |
|
| |/
|
|
|
| |
Since the "git config" command adds a newline to the end of its output, the extraneous whitespace needs to be stripped out for proper parsing.
Fixes #170
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
If a user specified `--max-complexity` on the command-line, they
would be told that it did not exist. The same would be true of any
option provided by a plugin. This is because we parse the command-line
arguments twice in Flake8 -- the first time to specify the verbosity
and destination for logging, the second time to actually execute Flake8.
Since plugin options are not registered to start with the first time,
they are not valid options. So when we first parse the options, we should
only attempt to parse the ones which we know about.
Closes #168
|
| | |
|