summaryrefslogtreecommitdiff
path: root/flake8
Commit message (Collapse)AuthorAgeFilesLines
* Move flake8 into srcIan Cordasco2016-06-2529-4358/+0
| | | | | This is an emerging best practice and there is little reason to not follow it
* Update version string to betaIan Cordasco2016-06-211-1/+2
| | | | Add a version info tuple for plugins to use
* Add missing docstring to Application#report_benchmarksIan Cordasco2016-06-201-0/+2
|
* Add --benchmark and formatting for its valuesIan Cordasco2016-06-196-6/+112
|
* Configure flake8-import-order to use Google StyleIan Cordasco2016-06-173-4/+10
| | | | | | | | 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.
* Add broken config file to test error handlingIan Cordasco2016-06-161-1/+7
| | | | | | | | | | | ConfigFileFinder should absolutely handle broken/invalid config files by refusing to try to parse them. Here we catch the ParsingError, log the exception, and then return normally. The RawConfigParser instance is perfectly valid still and will behave as if nothing had been read and we just need to indicate that we didn't find any files worthy of reading. Related to: https://github.com/PyCQA/pycodestyle/issues/506
* Add setuptools integrationIan Cordasco2016-06-161-0/+77
| | | | | | | | This proved simpler because I realized something important: Most of the code that the old integration was using was in fact doing nothing of value. Since we can't meaningfully allow users to use command-line options as parameters to `python setup.py flake8`, we just remove the work that we do to set up those attributes and parse them.
* Set a default value for --selectIan Cordasco2016-06-162-1/+2
| | | | | This allows us to add --append-to-select and --append-to-ignore at a later date that will work as expected and in a consistent manner.
* Find filenames for mercurial hookIan Cordasco2016-06-161-1/+19
| | | | | Extract the files changed in a particular commit or set of commits for the commit and qrefresh mercurial hooks.
* Use a template for git pre-commit hookIan Cordasco2016-06-161-2/+11
| | | | | | | | | | | | | Previously, we forced Flake8 to be installed in whatever Python environment that the user was using. This allows someone to use Flake8 from a virtual environment, e.g., if you use the tox.ini from this commit, you can do: tox -e venv -- flake8 --install-hook git And that will allow you to use the Python and Flake8 from ./.tox/venv/bin/python. This means that you can avoid installing Flake8 globally and still have a working commit hook.
* Ensure that the directories existIan Cordasco2016-06-161-0/+2
| | | | | | If we create our temporary directory structure for our files, we need to ensure that all the directories (including the ones in the filename) exist before we copy the contents to that location.
* Properly unpack stdout and stdinIan Cordasco2016-06-161-1/+1
| | | | | subprocess.Popen#communicate returns (stdout, stdin) but we were only unpacking stdout from it causing an exception.
* Use correct stat module constantIan Cordasco2016-06-161-1/+1
| | | | | Previously we were using stat.IROTH instead of stat.S_IROTH. I must have been thinking about retirement. ;-)
* Revert silliness around setting choices for --formatIan Cordasco2016-06-142-11/+8
| | | | | If we restrict the user's ability to specify a format string, we break existing workflows.
* Use the same interface for vcs installationIan Cordasco2016-06-142-4/+9
| | | | | | flake8.main.git.install was already returning False if it couldn't find the directory to install into. This makes mercurial.install do the same thing and allows the vcs.install callback to understand that.
* Add docstrings and a new-line for pydocstyleIan Cordasco2016-06-142-0/+3
|
* Start fleshing out mercurial hookIan Cordasco2016-06-134-7/+152
| | | | | | This also reports errors with hook installation using exceptions and includes far more exceptions for mercurial since it has more failure modes.
* Refactor parts of flake8.main.cli into separate modulesIan Cordasco2016-06-134-464/+472
|
* Correct usage of tempfileIan Cordasco2016-06-131-2/+2
| | | | The stdlib module is tempfile not tempdir ;-)
* Move git integration into flake8.mainIan Cordasco2016-06-134-6/+64
| | | | | | | | Also add the --install-hook option and plumb it's installation through flake8.main.vcs's function that understands how to install the desired VCS integration bits. Finally, we also mock out the mercurial integration.
* Make a first pass at a git pre-commit hookIan Cordasco2016-06-134-5/+219
|
* Convert flake8.api to a submoduleIan Cordasco2016-06-111-0/+0
|
* Add flake8.api and docs for itIan Cordasco2016-06-081-0/+10
| | | | Stub out the primary method people seem to use.
* Update our warning message about WindowsIan Cordasco2016-06-071-2/+4
|
* Check for version of Python on WindowsIan Cordasco2016-06-072-1/+16
| | | | | | | | | | Certain versions of Python on Windows are capable of using multiprocessing safely and correctly. Instead of completely disabling multiprocessing on Windows, this allows us to check for safe versions. This also updates our internal utility documentation to add missing functions and add a strongly worded warning about the API of those functions.
* Ensure that a file exists before processing itIan Cordasco2016-06-071-1/+13
| | | | | If we don't check for a file's existence, then we'll find ourselves with a hung subprocess due to an exception that happens with in it.
* Update default ignore for when we upgrade pep8Ian Cordasco2016-06-071-1/+1
|
* Add distinction between reported and ignored errorsIan Cordasco2016-06-073-7/+43
| | | | | This allows us to properly exit if no errors were reported (due to, for example, # noqa).
* Add tests for parse_unified_diffIan Cordasco2016-06-071-3/+6
| | | | | We could probably use non-git diff fixtures, but those are what we have for now.
* Add --stdin-display-name to modify report outputIan Cordasco2016-06-062-0/+9
|
* Allow reporting on files passed via stdinIan Cordasco2016-06-062-12/+1
|
* Wire up last pieces to make --diff workIan Cordasco2016-06-064-8/+84
| | | | | | | | To make sure we reduce as much duplication as possible, we parse the diff output in our main command-line Application. That then takes responsibility for telling the StyleGuide about the line numbers that are in the diff as well as telling the file checker manager which files from the diff should be checked.
* Add utils.parse_unified_diff functionIan Cordasco2016-06-061-0/+71
| | | | | | | | | | | | | This will read stdin using utils.stdin_get_value and parse it into a dictionary similar to pep8/pycodestyle's parse_udiff function. This differs from that function in the order in which it parses the diff and also in that it does not try to filter the paths in the diff. It lets a different level take care of that for it. This will likely be used to send paths to the FileCheckerManager and also send the ranges to the StyleGuide so it can filter errors not in those ranges.
* Fix linting issuesIan Cordasco2016-06-041-0/+1
|
* Use platform independent path separatorIan Cordasco2016-06-031-2/+5
| | | | | | | | | | | | When normalizing paths in flake8.utils, we use the os.path.sep constant to determine if the item is intended to be a path. If Windows users then have a path like foo\bar Specified, they will get the same behaviour as a *nix user with foo/bar
* Add tests for BaseFormatterIan Cordasco2016-06-011-12/+24
|
* Refactor Error formatting and handlingIan Cordasco2016-05-302-14/+48
| | | | | | | | This allows us to handle --show-source in our formatters by default. This also adds the physical line information to the Error class instead of passing it to is_inline_ignored. This allows us to avoid using linecache in our formatters.
* Rely on Python 3.4 backport of configparserIan Cordasco2016-05-301-5/+1
| | | | | | Python 2.7's ConfigParser module does not allow for the behaviour we have documented for config files in Flake8 3.0. To compensate for that, we add a dependency on the configparser backport on PyPI for Python 2.7
* Fix default printing for --exclude help textIan Cordasco2016-05-281-1/+1
|
* Refactor off-by-default plugins and enabling themIan Cordasco2016-05-283-3/+29
| | | | | | | | | | | We move the logic to add or remove a plugin from the default ignore list to individual methods on the Plugin class (Plugin#enable, Plugin#disable) and use that when registering and parsing options. If the plugin is off-by-default, Plugin#register_options will use Plugin#disable. When parsing options via Plugin#provide_options, if the plugin has been specified in --enable-extensions then it will be re-enabled via Plugin#enable.
* Start adding documentation about developing pluginsIan Cordasco2016-05-161-0/+1
|
* Document flake8.checker and flake8.processorIan Cordasco2016-05-141-14/+14
|
* Add a property for off-by-default pluginsIan Cordasco2016-05-101-0/+8
| | | | | If a plugin is off-by-default use its entry-point name (as we currently do in flake8 2.x) to add it to the default ignore list.
* Ignore --help/-h until later as wellIan Cordasco2016-05-101-2/+22
| | | | Explain why we remove --version, --help, and -h
* Ensure we provide options to all pluginsIan Cordasco2016-05-101-0/+6
|
* Handle determining plugin versions and namesIan Cordasco2016-05-103-15/+97
| | | | | | | Since we now treat pep8 checks each as an individual plugin, we need a way to represent pep8 as a single plugin in the version output (like we currently do). As such we need to be a bit wiser in how we tell the OptionManager about plugins and their versions and we only do this for certain plugins.
* Print version information the second time we parse argumentsIan Cordasco2016-05-101-1/+4
|
* Add documentation around the cliIan Cordasco2016-05-081-5/+73
|
* Print the total number of errors before exitingIan Cordasco2016-05-071-0/+11
|
* Implement --exit-zero functionalityIan Cordasco2016-05-071-1/+5
|