Commit cab28e68 authored by Ondřej Nový's avatar Ondřej Nový

Import python-flake8_3.0.3.orig.tar.gz

parent a6cf72ae
This diff is collapsed.
========================
Contributing to Flake8
========================
There are many ways to contriubte to |Flake8|, and we encourage them all:
- contributing bug reports and feature requests
- contributing documenation (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.
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, it's 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
== Flake8 License (MIT) ==
Copyright (C) 2011-2013 Tarek Ziade <tarek@ziade.org>
Copyright (C) 2012-2013 Ian Cordasco <graffatcolmingov@gmail.com>
Copyright (C) 2012-2016 Ian Cordasco <graffatcolmingov@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
......
include *.rst
include CONTRIBUTORS.txt
include LICENSE
recursive-include flake8 *
global-exclude *.pyc
recursive-include docs *.rst *.py
recursive-include tests *.py *.ini *.rst *_diff
recursive-include src *.py
prune docs/build/
This diff is collapsed.
======
Flake8
======
========
Flake8
========
Flake8 is a wrapper around these tools:
- PyFlakes
- pep8
- pycodestyle
- Ned Batchelder's McCabe script
Flake8 runs all the tools by launching the single ``flake8`` script.
Flake8 runs all the tools by launching the single ``flake8`` command.
It displays the warnings in a per-file, merged output.
It also adds a few features:
......@@ -18,80 +18,60 @@ It also adds a few features:
# flake8: noqa
- lines that contain a ``# noqa`` comment at the end will not issue warnings.
- a Git and a Mercurial hook.
- a McCabe complexity checker.
- extendable through ``flake8.extension`` entry points.
- you can ignore specific errors on a line with ``# noqa: <error>``, e.g.,
``# noqa: E234``
- Git and Mercurial hooks
- extendable through ``flake8.extension`` and ``flake8.formatting`` entry
points
QuickStart
Quickstart
==========
::
See our `quickstart documentation
<http://flake8.pycqa.org/en/latest/index.html#quickstart>`_ for how to install
and get started with Flake8.
pip install flake8
To run flake8 just invoke it against any directory or Python module::
$ flake8 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operato
coolproject/mod.py:729:1: F811 redefinition of function 'readlines' from line 723
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
The outputs of PyFlakes *and* pep8 (and the optional plugins) are merged
and returned.
Frequently Asked Questions
==========================
flake8 offers an extra option: --max-complexity, which will emit a warning if
the McCabe complexity of a function is higher than the value. By default it's
deactivated::
Flake8 maintains an `FAQ <http://flake8.pycqa.org/en/latest/faq.html>`_ in its
documentation.
$ flake8 --max-complexity 12 coolproject
coolproject/mod.py:97:1: F401 'shutil' imported but unused
coolproject/mod.py:625:17: E225 missing whitespace around operator
coolproject/mod.py:729:1: F811 redefinition of unused 'readlines' from line 723
coolproject/mod.py:939:1: C901 'Checker.check_all' is too complex (12)
coolproject/mod.py:1028:1: F841 local variable 'errors' is assigned to but never used
coolproject/mod.py:1204:1: C901 'selftest' is too complex (14)
This feature is quite useful to detect over-complex code. According to McCabe,
anything that goes beyond 10 is too complex.
See https://en.wikipedia.org/wiki/Cyclomatic_complexity.
Questions or Feedback
=====================
If you have questions you'd like to ask the developers, or feedback you'd like
to provide, feel free to use the mailing list: code-quality@python.org
Frequently Asked Questions
==========================
We would love to hear from you. Additionally, if you have a feature you'd like
to suggest, the mailing list would be the best place for it.
Why does flake8 pin the version of pep8?
----------------------------------------
Version 1.6 of pep8 doesn't work properly with flake8. Until pep8 releases a
version that works, flake8 pins the version of pep8 so that flake8 will work as
a whole.
Links
=====
Is flake8 broken?
-----------------
* `Flake8 Documentation <https://flake8.pycqa.org/en/latest/>`_
Flake8 combines two other projects that are significant on their own: pep8 and
PyFlakes. If flake8 is doing something you don't like, it is quite likely that
the problem lies in one of those other projects. You can run them separately
to see if they are the cause of your difficulties. We greatly appreciate your
efforts to diagnose the source of the problem before reporting bugs against
flake8.
* `GitLab Project <https://gitlab.com/pycqa/flake8>`_
* `All (Open and Closed) Issues
<https://gitlab.com/pycqa/flake8/issues?scope=all&sort=updated_desc&state=all>`_
Questions or Feedback
=====================
* `Code-Quality Archives
<https://mail.python.org/mailman/listinfo/code-quality>`_
If you have questions you'd like to ask the developers, or feedback you'd like
to provide, feel free to use the mailing list: code-quality@python.org We
would love to hear from you. Additionally, if you have a feature you'd like to
suggest, the mailing list would be the best place for it.
* `Code of Conduct
<http://flake8.pycqa.org/en/latest/internal/contributing.html#code-of-conduct>`_
.. _links:
* `Getting Started Contributing
<http://flake8.pycqa.org/en/latest/internal/contributing.html>`_
Links
=====
* `flake8 documentation <https://flake8.readthedocs.io/en/latest/>`_
Maintenance
===========
* `pep8 documentation <https://pep8.readthedocs.io/en/latest/>`_
Flake8 was created by Tarek Ziadé and is currently maintained by `Ian Cordasco
<https://coglib.com/~icordasc/>`_
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 55b5c554abc6926b5703672006d28269
tags: 645f666f9bcd5a90fca523b33c5a78b7
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>flake8.api &mdash; flake8 3.0.0b2 documentation</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="top" title="flake8 3.0.0b2 documentation" href="../../index.html"/>
<link rel="up" title="Module code" href="../index.html"/>
<script src="../../_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="../../index.html" class="icon icon-home"> flake8
</a>
<div class="version">
3.0.0b2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../faq.html">Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary.html">Glossary of Terms Used in Flake8 Documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">Using Flake8</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../plugin-development/index.html">Writing Plugins for Flake8</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../internal/index.html">Exploring Flake8&#8217;s Internals</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../release-notes/index.html">Release Notes and History</a></li>
</ul>