summaryrefslogtreecommitdiff
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* fix test name after refactorAnthony Sottile2021-09-081-2/+2
|
* write directly to sys.stdout.buffer to avoid windows io encodingAnthony Sottile2021-09-081-19/+8
|
* test using python3.10Anthony Sottile2021-08-151-14/+7
|
* short circuit on ast error before tokenization errorAnthony Sottile2021-04-182-25/+0
|
* extend black formatting to tests as wellAnthony Sottile2021-04-1823-956/+1217
|
* Fix bug for plugins using extend_default_ignorefix-extend-default-ignoreIan Stapleton Cordasco2021-04-152-178/+400
| | | | | | | | | | | | | | 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
* Add --extend-select command line argumentFrank Winklmeier2021-04-112-16/+26
| | | | | | | | | 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.
* improve code coverage in a few placesAnthony Sottile2021-04-071-0/+7
|
* fix mypy errorsAnthony Sottile2021-04-072-46/+32
|
* fix links in codeAnthony Sottile2021-04-031-1/+1
|
* audit + string joiningAnthony Sottile2021-03-301-1/+1
|
* clean up version_info referencesAnthony Sottile2021-03-301-1/+0
|
* automatic: pyupgrade --py36-plusAnthony Sottile2021-03-3019-28/+31
|
* introduce pyupgrade, run it in python2-compatible modeAnthony Sottile2021-03-291-1/+1
|
* remove flake8 setuptools commandAnthony Sottile2021-03-291-33/+0
|
* remove vcs integrationAnthony Sottile2021-03-291-29/+0
|
* upgrade pycodestyle to 2.7.0Anthony Sottile2021-03-141-0/+1
|
* ensure crlf line endings of stdin are handled properlyAnthony Sottile2021-01-071-0/+10
|
* fix test which was not testing anythingAnthony Sottile2021-01-071-3/+5
|
* fix a few small spelling issuesAnthony Sottile2020-09-202-3/+3
| | | | found via `pre-commit try-repo https://github.com/codespell-project/codespell --all-files`
* fix JobsArgument --help outputRuairidh MacLeod2020-06-051-0/+6
|
* config: Normalize paths in CLI-specified config relative to config dirEric N. Vander Weele2020-05-181-6/+7
| | | | | | | | 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.
* Parse --jobs as a custom argparse type. Fixes #567Ruairidh MacLeod2020-05-132-1/+32
|
* Fix using --exclude=.* to not match `.` and `..`Anthony Sottile2020-05-071-0/+8
|
* Fix type='str' optparse optionsAnthony Sottile2020-04-241-0/+2
|
* instrument coverage on tests and require 100% coverage thereAnthony Sottile2020-03-235-10/+13
|
* Allow noqa to apply to lines due to continuationnoqa_continuationAnthony Sottile2020-03-171-5/+45
|
* config: Determine path to user configuration immediatelyEric N. Vander Weele2020-01-202-21/+6
| | | | | | | | | | | | | | | 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.
* config: Remove checks for configs being previously parsedEric N. Vander Weele2020-01-201-24/+0
| | | | | | 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.
* split lines the same when read from stdinAnthony Sottile2020-01-161-13/+4
|
* config: Make ConfigFileFinder 'extra_config_files' parameter optionalEric N. Vander Weele2020-01-124-17/+12
| | | | | This simplifies the number of required parameters needed for the `ConfigFileFinder` object throughout the various tests.
* Remove unused 'cli_config' parameterEric N. Vander Weele2020-01-123-4/+4
| | | | | | 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.
* config: Switch code paths to use 'ConfigFileFinder.config_file'Eric N. Vander Weele2020-01-122-4/+8
| | | | | | | | 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.
* config: Add 'config_file' parameter to ConfigFileFinderEric N. Vander Weele2020-01-121-0/+17
| | | | | | | | | 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.
* config: Remove ConfigFileFinder 'parent' and 'tail' attributesEric N. Vander Weele2020-01-121-3/+4
| | | | | | | 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.
* tests: Ensure patched `os.getcwd()` is an absolute pathEric N. Vander Weele2020-01-121-3/+3
| | | | | | | | | | | `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.
* Remove unused 'isolated' parameterEric N. Vander Weele2020-01-073-4/+6
| | | | | | Now that `ConfigFileFinder.ignore_config_files` attribute is used everywhere and is constructed from the `--isolated` CLI option, the now unused `isolated` parameters can be safely removed.
* config: Switch code paths to use 'ConfigFileFinder.ignore_config_files'Eric N. Vander Weele2020-01-072-0/+2
| | | | | | | | | Now that the `ConfigFileFinder` has the `.ignore_config_files` attribute, switch the relevant code paths to utilize this public attribute. Tests have been updated to either construct `ConfigFileFinder` or mock the object appropriately.
* config: Add 'ignore_config_files' parameter to ConfigFileFinderEric N. Vander Weele2020-01-071-0/+20
| | | | | | | | | The `--isolated` 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 isolation pertains to how the `ConfigFileFinder` should behave with respect to isolation, this incremental change more directly associates the `ConfigFileFinder` and configuration file isolate.
* config: Change ConfigFileFinder._read_config() to accept variadic argsEric N. Vander Weele2020-01-062-3/+3
| | | | | | | | | | | | | This simplifies `._read_config()` by removing a conditional branch in the situation where it is called with one file to process. Now the contract accepts any number of arguments of the same type. Where callers invoke `._read_config()` with a `Sequence`, the call site has been changed to unpack arguments (i.e., `*`). The tests in `test_merged_config_parser.py` needed to return a string for the user configuration path instead of an empty list since `ConfigFileFinder.user_config_file()` returns a string.
* aggregator: Forward --config and --isolated options during aggregationEric N. Vander Weele2019-12-291-1/+1
| | | | | | | | | | | | | | This fixes a regression introduced in !346 to ensure that `--config` and `--isolated` are recognized in `aggregate_options()`. The regression manifested because `aggregate_options()` was relying on re-parsing `argv` to obtain the option values. However, !346 changed the preliminary parsing logic to only parse and "eat" what is necessary and forward along the options needed before all the configuration was loaded. This code path was overlooked because the tests in `test_aggregator()` were passing but the call from the `Application` object would never have these options in the remaining `argv` list to be passed long.
* application: Inline creation of config.ConfigFileFinderEric N. Vander Weele2019-12-031-6/+7
| | | | | | Simplify the initialization code path by invoking `config.ConfigFileFinder` directly instead of the extra hop by calling the static class-level `Application.make_config_finder()` method.
* Merge branch 'fix/disable_noqa' into 'master'Anthony Sottile2019-12-032-0/+11
|\ | | | | | | | | | | | | `--disable-noqa` does not override `# flake8: noqa` Closes #590 See merge request pycqa/flake8!380
| * Remove redundant sample dataIsac Yoo2019-11-131-9/+2
| |
| * Fix codesByeonghoon Yoo2019-11-061-20/+30
| |
| * Add unit test for dd411e95Byeonghoon Yoo2019-11-052-13/+21
| |
* | Merge branch 'fix/exit-zero' into 'master'Anthony Sottile2019-12-021-17/+4
|\ \ | | | | | | | | | | | | Fix --exit-zero when --diff is empty See merge request pycqa/flake8!391
| * | Fixes --exit-zero when empty --diffKinya TERASAKA2019-12-021-17/+4
| | | | | | | | | | | | fixes pycqa/flake8/merge_requests!137
* | | Switch from entrypoints to importlib_metadataAnthony Sottile2019-11-284-45/+31
|/ /
* | application: Remove configuration finder stateEric N. Vander Weele2019-11-221-2/+6
| | | | | | | | | | | | | | This change removes the `.config_finder` object from the `Application`. Since the configuration finder is only needed during initialization, we constrain the finder to be returned and passed to other methods necessary for initialization.