Commit 244fa88a authored by Ondřej Nový's avatar Ondřej Nový

merge patched into master

parents f510f33f df970210
========================
Contributing to Flake8
========================
There are many ways to contriubte to |Flake8|, and we encourage them all:
- contributing bug reports and feature requests
- contributing documentation (and yes that includes this document)
- reviewing and triaging bugs and merge requests
Before you go any further, please allow me to reassure you that I do want
*your* contribution. If you think your contribution might not be valuable, I
reassure you that any help you can provide *is* valuable.
Code of Conduct
===============
|Flake8| adheres to the `Python Code Quality Authority's Code of Conduct`_.
Any violations of the Code of Conduct should be reported to Ian Cordasco
(graffatcolmingov [at] gmail [dot] com).
Setting Up A Development Environment
====================================
To contribute to |Flake8|'s development, you simply need:
- Python (one of the versions we support)
- `tox`_
We suggest installing this like:
.. prompt:: bash
pip install --user tox
Or
.. prompt:: bash
python<version> -m pip install --user tox
- your favorite editor
Filing a Bug
============
When filing a bug against |Flake8|, please fill out the issue template as it
is provided to you by `GitLab`_. If your bug is in reference to one of the
checks that |Flake8| reports by default, please do not report them to |Flake8|
unless |Flake8| is doing something to prevent the check from running or you
have some reason to believe |Flake8| is inhibiting the effectiveness of the
check.
**Please search for closed and open bug reports before opening new ones.**
All bug reports about checks should go to their respective projects:
- Error codes starting with ``E`` and ``W`` should be reported to
`pycodestyle`_.
- Error codes starting with ``F`` should be reported to `pyflakes`_
- Error codes starting with ``C`` should be reported to `mccabe`_
Requesting a New Feature
========================
When requesting a new feature in |Flake8|, please fill out the issue template.
Please also note if there are any existing alternatives to your new feature
either via plugins, or combining command-line options. Please provide example
use cases. For example, do not ask for a feature like this:
I need feature frobulate for my job.
Instead ask:
I need |Flake8| to frobulate these files because my team expects them to
frobulated but |Flake8| currently does not frobulate them. We tried using
``--filename`` but we could not create a pattern that worked.
The more you explain about *why* you need a feature, the more likely we are to
understand your needs and help you to the best of our ability.
Contributing Documentation
==========================
To contribute to |Flake8|'s documentation, you might want to first read a
little about reStructuredText or Sphinx. |Flake8| has a :ref:`guide of best
practices <docs-style>` when contributing to our documentation. For the most
part, you should be fine following the structure and style of the rest of
|Flake8|'s documentation.
All of |Flake8|'s documentation is written in reStructuredText and rendered by
Sphinx. The source (reStructuredText) lives in ``docs/source/``. To build
the documentation the way our Continuous Integration does, run:
.. prompt:: bash
tox -e docs
To view the documentation locally, you can also run:
.. prompt:: bash
tox -e serve-docs
You can run the latter in a separate terminal and continuously re-run the
documentation generation and refresh the documentation you're working on.
.. note::
We lint our documentation just like we lint our code.
You should also run:
.. prompt:: bash
tox -e linters
After making changes and before pushing them to ensure that they will
pass our CI tests.
Contributing Code
=================
|Flake8| development happens on `GitLab`_. Code contributions should be
submitted there.
Merge requests should:
- Fix one issue and fix it well
Fix the issue, but do not include extraneous refactoring or code
reformatting. In other words, keep the diff short, but only as short
as is necessary to fix the bug appropriately and add sufficient testing
around it. Long diffs are fine, so long as everything that it includes
is necessary to the purpose of the merge request.
- Have descriptive titles and descriptions
Searching old merge requests is made easier when a merge request is well
described.
- Have commits that follow this style:
.. code::
Create a short title that is 50 characters long
Ensure the title and commit message use the imperative voice. The
commit and you are doing something. Also, please ensure that the
body of the commit message does not exceed 72 characters.
The body may have multiple paragraphs as necessary.
The final line of the body references the issue appropriately.
- Follow the guidelines in :ref:`writing-code`
Reviewing and Triaging Issues and Merge Requests
================================================
When reviewing other people's merge requests and issues, please be
**especially** mindful of how the words you choose can be read by someone
else. We strive for professional code reviews that do not insult the
contributor's intelligence or impugn their character. The code review
should be focused on the code, its effectiveness, and whether it is
appropriate for |Flake8|.
If you have the ability to edit an issue or merge request's labels, please do
so to make search and prioritization easier.
|Flake8| uses milestones with both issues and merge requests. This provides
direction for other contributors about when an issue or merge request will be
delivered.
.. links
.. _Python Code Quality Authority's Code of Conduct:
http://meta.pycqa.org/en/latest/code-of-conduct.html
.. _tox:
https://tox.readthedocs.io/
.. _GitLab:
https://gitlab.com/pycqa/flake8
.. _pycodestyle:
https://github.com/pycqa/pycodestyle
.. _pyflakes:
https://github.com/pyflakes/pyflakes
.. _mccabe:
https://github.com/pycqa/mccabe
Please refer to `Contributing to Flake8
<http://flake8.pycqa.org/en/latest/internal/contributing.html>`_
on our website.
Metadata-Version: 1.1
Name: flake8
Version: 3.3.0
Version: 3.4.1
Summary: the modular source code checker: pep8, pyflakes and co
Home-page: https://gitlab.com/pycqa/flake8
Author: Ian Cordasco
Author: Ian Stapleton Cordasco
Author-email: graffatcolmingov@gmail.com
License: MIT
Description: ========
......
# see git-dpm(1) from git-dpm package
b5475f8925a960108ce9acf63517c63d445b2b1d
b5475f8925a960108ce9acf63517c63d445b2b1d
2d696618b181dcd3940e8ed0daa44e3e30529686
df9702106ebd481a9660de73757a7b7b1c651e63
df9702106ebd481a9660de73757a7b7b1c651e63
e9c6162434192f7a082391f7e22045e0cd9f55e9
e9c6162434192f7a082391f7e22045e0cd9f55e9
python-flake8_3.4.1.orig.tar.gz
169037b8e5438edb756e7cdca8016134c03e6a36
......
From b5475f8925a960108ce9acf63517c63d445b2b1d Mon Sep 17 00:00:00 2001
From df9702106ebd481a9660de73757a7b7b1c651e63 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= <onovy@debian.org>
Date: Thu, 3 Nov 2016 21:43:46 +0100
Subject: Remove upper constrains from upstream requirements
......@@ -26,7 +26,7 @@ index de6418f..913fd74 100644
[egg_info]
tag_build =
diff --git a/setup.py b/setup.py
index 5a40d9b..73e00c4 100644
index de350a8..e0d3b24 100644
--- a/setup.py
+++ b/setup.py
@@ -17,9 +17,9 @@ tests_require = ['mock >= 2.0.0', 'pytest']
......@@ -39,6 +39,6 @@ index 5a40d9b..73e00c4 100644
+ "pyflakes >= 1.5.0",
+ "pycodestyle >= 2.0.0",
+ "mccabe >= 0.6.0",
"setuptools >= 30",
]
if sys.version_info < (3, 4):
......@@ -54,8 +54,8 @@ master_doc = 'index'
# General information about the project.
project = u'flake8'
copyright = u'2016, Ian Cordasco'
author = u'Ian Cordasco'
copyright = u'2016, Ian Stapleton Cordasco'
author = u'Ian Stapleton Cordasco'
import flake8
# The version info for the project you're documenting, acts as replacement for
......@@ -235,7 +235,7 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'flake8.tex', u'flake8 Documentation',
u'Ian Cordasco', 'manual'),
u'Ian Stapleton Cordasco', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
......
......@@ -19,8 +19,8 @@ Code of Conduct
===============
|Flake8| adheres to the `Python Code Quality Authority's Code of Conduct`_.
Any violations of the Code of Conduct should be reported to Ian Cordasco
(graffatcolmingov [at] gmail [dot] com).
Any violations of the Code of Conduct should be reported to Ian Stapleton
Cordasco (graffatcolmingov [at] gmail [dot] com).
Setting Up A Development Environment
......
......@@ -106,8 +106,9 @@ Reporting Violations
Next, the application takes the violations from the file checker manager, and
feeds them through the :class:`~flake8.style_guide.StyleGuide`. This
determines whether the particular :term:`error code` is selected or ignored
and then appropriately sends it to the formatter (or not).
relies on a :class:`~flake8.style_guide.DecisionEngine` instance to determine
whether the particular :term:`error code` is selected or ignored and then
appropriately sends it to the formatter (or not).
Reporting Benchmarks
--------------------
......
3.4.0 -- 2017-07-27
-------------------
You can view the `3.4.0 milestone`_ on GitLab for more details.
- Refine logic around ``--select`` and ``--ignore`` when combined with the
default values for each. (See also `GitLab#318`_)
- Handle spaces as an alternate separate for error codes, e.g.,
``--ignore 'E123 E234'``. (See also `GitLab#329`_)
- Filter out empty select and ignore codes, e.g., ``--ignore E123,,E234``.
(See also `GitLab#330`_)
- Specify dependencies appropriately in ``setup.py`` (See also `Gitlab#341_`)
- Fix bug in parsing ``--quiet`` and ``--verbose`` from config files.
(See also `GitLab!193`_)
- Remove unused import of ``os`` in the git hook template (See also
`GitLab!194`_)
.. all links
.. _3.4.0 milestone:
https://gitlab.com/pycqa/flake8/milestones/18
.. issue links
.. _GitLab#318:
https://gitlab.com/pycqa/flake8/issues/318
.. _GitLab#329:
https://gitlab.com/pycqa/flake8/issues/329
.. _GitLab#330:
https://gitlab.com/pycqa/flake8/issues/330
.. _GitLab#341:
https://gitlab.com/pycqa/flake8/issues/341
.. merge request links
.. _GitLab!193:
https://gitlab.com/pycqa/flake8/merge_requests/193
.. _GitLab!194:
https://gitlab.com/pycqa/flake8/merge_requests/194
3.4.1 -- 2017-07-28
-------------------
You can view the `3.4.1 milestone`_ on GitLab for more details.
- Fix minor regression when users specify only a ``--select`` list with items
in the enabled/extended select list. (See also `GitLab#354`_)
.. all links
.. _3.4.1 milestone:
https://gitlab.com/pycqa/flake8/milestones/19
.. issue links
.. _GitLab#354:
https://gitlab.com/pycqa/flake8/issues/354
.. merge request links
......@@ -9,6 +9,8 @@ with the newest releases first.
==================
.. toctree::
3.4.1
3.4.0
3.3.0
3.2.1
3.2.0
......
......@@ -70,6 +70,9 @@ generates its own :term:`error code`\ s for ``pyflakes``:
| F841 | local variable ``name`` is assigned to but never used |
+------+---------------------------------------------------------------------+
Note that some of these entries behave differently on Python 2 and Python 3,
for example F812 is specific to Python 2 only.
We also report one extra error: ``E999``. We report ``E999`` when we fail to
compile a file into an Abstract Syntax Tree for the plugins that require it.
......
......@@ -24,7 +24,7 @@ This guide will cover all of these and the nuances for using |Flake8|.
configuration
options
error-codes
ignoring-errors
violations
using-plugins
using-hooks
python-api
......
......@@ -10,6 +10,8 @@
.. option:: --<opt-name>[=<descriptive-name-of-parameter>]
:ref:`Go back to index <top>`
Active description of option's purpose (note that each description
starts with an active verb)
......@@ -25,10 +27,87 @@
Thank you for your contribution to Flake8's documentation.
.. _top:
Index of Options
================
- :option:`flake8 --version`
- :option:`flake8 --help`
- :option:`flake8 --verbose`
- :option:`flake8 --quiet`
- :option:`flake8 --count`
- :option:`flake8 --diff`
- :option:`flake8 --exclude`
- :option:`flake8 --filename`
- :option:`flake8 --stdin-display-name`
- :option:`flake8 --format`
- :option:`flake8 --hang-closing`
- :option:`flake8 --ignore`
- :option:`flake8 --max-line-length`
- :option:`flake8 --select`
- :option:`flake8 --disable-noqa`
- :option:`flake8 --show-source`
- :option:`flake8 --statistics`
- :option:`flake8 --enable-extensions`
- :option:`flake8 --exit-zero`
- :option:`flake8 --install-hook`
- :option:`flake8 --jobs`
- :option:`flake8 --output-file`
- :option:`flake8 --tee`
- :option:`flake8 --append-config`
- :option:`flake8 --config`
- :option:`flake8 --isolated`
- :option:`flake8 --builtins`
- :option:`flake8 --doctests`
- :option:`flake8 --include-in-doctest`
- :option:`flake8 --exclude-from-doctest`
- :option:`flake8 --benchmark`
- :option:`flake8 --bug-report`
- :option:`flake8 --max-complexity`
Options and their Descriptions
==============================
.. program:: flake8
.. option:: --version
:ref:`Go back to index <top>`
Show |Flake8|'s version as well as the versions of all plugins
installed.
......@@ -43,6 +122,8 @@
.. option:: -h, --help
:ref:`Go back to index <top>`
Show a description of how to use |Flake8| and its options.
Command-line usage:
......@@ -57,6 +138,8 @@
.. option:: -v, --verbose
:ref:`Go back to index <top>`
Increase the verbosity of |Flake8|'s output. Each time you specify
it, it will print more and more information.
......@@ -77,6 +160,8 @@
.. option:: -q, --quiet
:ref:`Go back to index <top>`
Decrease the verbosity of |Flake8|'s output. Each time you specify it,
it will print less and less information.
......@@ -97,6 +182,8 @@
.. option:: --count
:ref:`Go back to index <top>`
Print the total number of errors.
Command-line example:
......@@ -116,6 +203,8 @@
.. option:: --diff
:ref:`Go back to index <top>`
Use the unified diff provided on standard in to only check the modified
files and report errors included in the diff.
......@@ -130,6 +219,8 @@
.. option:: --exclude=<patterns>
:ref:`Go back to index <top>`
Provide a comma-separated list of glob patterns to exclude from checks.
This defaults to: ``.svn,CVS,.bzr,.hg,.git,__pycache__,.tox``
......@@ -162,6 +253,8 @@
.. option:: --filename=<patterns>
:ref:`Go back to index <top>`
Provide a comma-separate list of glob patterns to include for checks.
This defaults to: ``*.py``
......@@ -194,6 +287,8 @@
.. option:: --stdin-display-name=<display_name>
:ref:`Go back to index <top>`
Provide the name to use to report warnings and errors from code on stdin.
Instead of reporting an error as something like:
......@@ -218,6 +313,8 @@
.. option:: --format=<format>
:ref:`Go back to index <top>`
Select the formatter used to display errors to the user.
This defaults to: ``default``
......@@ -262,6 +359,8 @@
.. option:: --hang-closing
:ref:`Go back to index <top>`
Toggle whether pycodestyle should enforce matching the indentation of the
opening bracket's line. When you specify this, it will prefer that you
hang the closing bracket rather than match the indentation.
......@@ -284,6 +383,8 @@
.. option:: --ignore=<errors>
:ref:`Go back to index <top>`
Specify a list of codes to ignore. The list is expected to be
comma-separated, and does not need to specify an error code exactly.
Since |Flake8| 3.0, this **can** be combined with :option:`--select`. See
......@@ -317,6 +418,8 @@
.. option:: --max-line-length=<n>
:ref:`Go back to index <top>`
Set the maximum length that any line (with some exceptions) may be.
Exceptions include lines that are either strings or comments which are
......@@ -349,6 +452,8 @@
.. option:: --select=<errors>
:ref:`Go back to index <top>`
Specify the list of error codes you wish |Flake8| to report. Similarly to
:option:`--ignore`. You can specify a portion of an error code to get all
that start with that string. For example, you can use ``E``, ``E4``,
......@@ -387,6 +492,8 @@
.. option:: --disable-noqa
:ref:`Go back to index <top>`
Report all errors, even if it is on the same line as a ``# NOQA`` comment.
``# NOQA`` can be used to silence messages on specific lines. Sometimes,
users will want to see what errors are being silenced without editing the
......@@ -411,6 +518,8 @@
.. option:: --show-source
:ref:`Go back to index <top>`
Print the source code generating the error/warning in question.
Command-line example:
......@@ -431,6 +540,8 @@
.. option:: --statistics
:ref:`Go back to index <top>`
Count the number of occurrences of each error/warning code and
print a report.
......@@ -451,6 +562,8 @@
.. option:: --enable-extensions=<errors>
:ref:`Go back to index <top>`
Enable off-by-default extensions.
Plugins to |Flake8| have the option of registering themselves as
......@@ -479,6 +592,8 @@
.. option:: --exit-zero
:ref:`Go back to index <top>`
Force |Flake8| to use the exit status code 0 even if there are errors.
By default |Flake8| will exit with a non-zero integer if there are errors.
......@@ -494,6 +609,8 @@
.. option:: --install-hook=VERSION_CONTROL_SYSTEM
:ref:`Go back to index <top>`
Install a hook for your version control system that is executed before
or during commit.
......@@ -514,6 +631,8 @@
.. option:: --jobs=<n>
:ref:`Go back to index <top>`
Specify the number of subprocesses that |Flake8| will use to run checks in
parallel.
......@@ -544,6 +663,8 @@
.. option:: --output-file=<path>
:ref:`Go back to index <top>`
Redirect all output to the specified file.
Command-line example:
......@@ -565,6 +686,8 @@
.. option:: --tee
:ref:`Go back to index <top>`
Also print output to stdout if output-file has been configured.
Command-line example:
......@@ -585,6 +708,8 @@
.. option:: --append-config=<config>
:ref:`Go back to index <top>`
Provide extra config files to parse in after and in addition to the files
that |Flake8| found on its own. Since these files are the last ones read
into the Configuration Parser, so it has the highest precedence if it
......@@ -601,6 +726,8 @@
.. option:: --config=<config>
:ref:`Go back to index <top>`
Provide a path to a config file that will be the only config file read and
used. This will cause |Flake8| to ignore all other config files that
exist.
......@@ -616,6 +743,8 @@
.. option:: --isolated
:ref:`Go back to index <top>`
Ignore any config files and use |Flake8| as if there were no config files
found.
......@@ -630,6 +759,8 @@
.. option:: --builtins=<builtins>
:ref:`Go back to index <top>`
Provide a custom list of builtin functions, objects, names, etc.
This allows you to let pyflakes know about builtins that it may
......@@ -658,6 +789,8 @@
.. option:: --doctests
:ref:`Go back to index <top>`
Enable PyFlakes syntax checking of doctests in docstrings.
This is registered by the default PyFlakes plugin.
......@@ -679,6 +812,8 @@
.. option:: --include-in-doctest=<paths>
:ref:`Go back to index <top>`
Specify which files are checked by PyFlakes for doctest syntax.
This is registered by the default PyFlakes plugin.
......@@ -705,6 +840,8 @@
.. option:: --exclude-from-doctest=<paths>
:ref:`Go back to index <top>`
Specify which files are not to be checked by PyFlakes for doctest syntax.
This is registered by the default PyFlakes plugin.
......@@ -731,6 +868,8 @@
.. option:: --benchmark
:ref:`Go back to index <top>`
Collect and print benchmarks for this run of |Flake8|. This aggregates the
total number of:
......@@ -752,6 +891,8 @@
.. option:: --bug-report
:ref:`Go back to index <top>`
Generate information necessary to file a complete bug report for Flake8.
This will pretty-print a JSON blob that should be copied and pasted into a
bug report for Flake8.
......@@ -796,3 +937,26 @@
}
This **can not** be specified in config files.
.. option:: --max-complexity=<n>
:ref:`Go back to index <top>`
Set the maximum allowed McCabe complexity value for a block of code.
This option is provided by the ``mccabe`` dependency's |Flake8| plugin.
Command-line usage:
.. prompt:: bash
flake8 --max-complexity 15 dir/
This **can** be specified in config files.
Example config file usage:
.. code-block:: ini
max-complexity = 15