| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Closes #1372
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since Flake8 3.0 we've had the ability for plugins to use
`extend_default_ignore` to register codes they want disabled by default.
This, however, was a permanent disabling unfortunately. Our code didn't
have a way of understanding that this new set of `ignore` codes was
actually the 'default' set for that run. Much like the
extended_select_list, we now attach extended_ignore_list to be able to
confidently determine if the ignore we get in the DecisionEngine is
actually the Default Ignore list and what plugins what us to ignore by
default.
Refs https://github.com/PyCQA/pep8-naming/pull/157
|
| |
|
|
|
|
|
|
|
| |
Implement `--extend-select` command line argument following what was
done for `--extend-ignore` in !233. This option can be used to
selectively add individual codes without overriding the default list
entirely.
Addresses the remaining item of issue #1061.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Add option to disable show-source for calling tools
See merge request pycqa/flake8!441
|
| | | |
|
| | |
| |
| |
| | |
found via `pre-commit try-repo https://github.com/codespell-project/codespell --all-files`
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Platforms such as Termux on Android, and other exotic devices
do not provide a sem_open implementation on the OS level. This
is problematic, as the error resulting from this occurs when
calling multiprocessing.Pool, throwing an unhandled ImportError.
The issue itself is outlined in https://bugs.python.org/issue3770.
This change allows devices missing this system call to respond
to the missing feature by falling back to synchronous execution,
which appears to be the default behaviour if the multiprocessing
module is not found.
This change also adds a potential fix for developers working
on platforms where multiprocessing itself cannot be imported.
The existing code would set the name referencing the import to
None, but there are no clear checks to ensure this does not
result in an AttributeError later when multiprocessing.Pool
has accession attempts.
Existing users should see no difference in functionality, as they
will assumably already be able to use flake8, so will not be
missing this sem_open call.
Users on devices without the sem_open call will now be able
to use flake8 where they would be unable to before due to
unhandled ImportErrors.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pytest 6.0.0rc1 attempts to log a repr of our mocked entry_point,
but it fails, becasue the repr metohod expects a valua attribute:
Reproducer:
$ tox -e py38 --force-dep 'pytest==6.0.0rc1'
...
Traceback (most recent call last):
File "/usr/lib/python3.8/logging/__init__.py", line 1081, in emit
msg = self.format(record)
File "/usr/lib/python3.8/logging/__init__.py", line 925, in format
return fmt.format(record)
File "/usr/lib/python3.8/logging/__init__.py", line 664, in format
record.message = record.getMessage()
File "/usr/lib/python3.8/logging/__init__.py", line 369, in getMessage
msg = msg % self.args
File "/tmp/flake8/.tox/py38/lib/python3.8/site-packages/flake8/plugins/manager.py", line 44, in __repr__
self.name, self.entry_point.value
File "/tmp/flake8/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 632, in __getattr__
raise AttributeError("Mock object has no attribute %r" % name)
AttributeError: Mock object has no attribute 'value'
|
| | |
|
| |
|
|
|
| |
`tokenize.generate_tokens()` can also raise `SyntaxError` in addition to
`tokenize.TokenError`.
|
| | |
|
| |
|
|
|
|
|
|
| |
Paths specified in configuration files should be relative to the
directory where the configuration file resides. Formerly, paths were
normalized relative to the current working directory where `flake8` was
invoked. The former behavior was not expected, especially for directory
structures with subprojects each having their own configuration.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This fixes a regression introduced in daca2c8 and b14d47b.
The --output-file` option was consumed by the preliminary option parser.
However, the `BaseFormatter` class needs the option for setting the
output filename. This special cases this option to ensure it gets
re-parsed and respected when specified on the CLI.
|
| |\
| |
| |
| |
| |
| |
| | |
Fix using --exclude=.* to not match `.` and `..`
Closes #632
See merge request pycqa/flake8!424
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Preemptively determine the path of the user configuration file during
the construction of the `ConfigFileFinder` object. The user
configuration path will always be the same, regardless of when it gets
obtained by a run of `flake8`.
This isolates the logic of determining the user configuration path into
a static helper method to be called to set the `.user_config_file`
attribute. The helper method leverages `utils.is_windows()`, instead of
reimplementing the check, and decomposes clearly the directory name and
the base name to construct the path with a single `return` path.
Additionally, this avoids reconstructing the path on demand of obtaining
the user configuration file path.
|
| |
|
|
|
|
| |
Remove the checks to see if a configuration file has already been seen
and parsed. These checks aren't necessary because the entire run of
`flake8` calls these methods *only* once per configuration provided.
|
| |\
| |
| |
| |
| |
| |
| | |
Ensure that a not-found file produces an error
Closes #600
See merge request pycqa/flake8!404
|
| | |
| |
| |
| | |
- this restores a flake8 2.x behaviour that was lost in the refactor
|
| |/ |
|
| |
|
|
|
| |
This simplifies the number of required parameters needed for the
`ConfigFileFinder` object throughout the various tests.
|
| |
|
|
|
|
| |
Now that `ConfigFileFinder.config_file` attribute is used everywhere and
is constructed from the `--config` CLI option, the now unused
`cli_config` parameters can be safely removed.
|
| |
|
|
|
|
|
|
| |
Now that the `ConfigFileFinder` has the `.config_file` attribute, switch
the relevant code paths to utilize this public attribute.
Tests have been updated to either construct `ConfigFileFinder` or mock
the object appropriately.
|
| |
|
|
|
|
|
|
|
| |
The `--config` flag is passed into `MergedConfigParser.parse()` and the
module-level function `config.get_local_plugins()`. Since both of these
places utilize the `ConfigFileFinder` object and the configuration file
override pertains to how configuration behaves, this incremental change
directly associates the `ConfigFileFinder` and the configuration file
override.
|
| |
|
|
|
|
|
| |
These attributes are only needed within the
`.generate_possible_local_files()` method. Therefore, just obtain the
current working directory at the beginning of the method and reduce the
lifetime state of the `ConfigFileFinder` object.
|
| |
|
|
|
|
|
|
|
|
|
| |
`os.getcwd()` returns an absolute path; thus, the patched paths should
be absolute as well.
This is an incremental change towards removing the `ConfigFileFinder`
attributes `.parent` and `.tail` to be localized to
`.generate_possible_local_files()`. Without this, the tests fail when
moving the patching because `os.path.abspath()` calls `os.getcwd()`,
expecting `os.getcwd()` to be an absolute path.
|