Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tk0miya/flake8-coding
https://github.com/tk0miya/flake8-coding
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tk0miya/flake8-coding
- Owner: tk0miya
- License: apache-2.0
- Created: 2015-03-19T03:56:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-16T13:44:20.000Z (over 5 years ago)
- Last Synced: 2024-10-14T10:56:01.371Z (25 days ago)
- Language: Python
- Size: 36.1 KB
- Stars: 15
- Watchers: 5
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-coding - Adds coding magic comment checks (coding:) to flake8. (Comments)
README
Flake8 Coding plugin
=====================.. image:: https://travis-ci.org/tk0miya/flake8-coding.svg?branch=master
:target: https://travis-ci.org/tk0miya/flake8-coding.. image:: https://coveralls.io/repos/tk0miya/flake8-coding/badge.svg?branch=master
:target: https://coveralls.io/r/tk0miya/flake8-coding?branch=master.. image:: https://codeclimate.com/github/tk0miya/flake8-coding/badges/gpa.svg
:target: https://codeclimate.com/github/tk0miya/flake8-coding
:alt: Code ClimateAdds coding magic comment checks (``coding:``) to ``flake8``.
Install
--------Install with pip::
$ pip install flake8-coding
You can check that ``flake8`` has picked it up by looking for ``flake8_coding``
in the output of ``--version``:.. code-block:: sh
$ flake8 --version
2.5.4 (pep8: 1.7.0, pyflakes: 1.0.0, flake8_coding: 1.1.1, mccabe: 0.4.0) CPython 2.7.11 on DarwinOptions
-------``accept-encodings``
~~~~~~~~~~~~~~~~~~~~A comma-separated list of acceptable source code encodings for the ``coding:``
magic comments in files. Default is ``latin-1, utf-8``.You can pass this as a command-line argument to ``flake8``, e.g.
``--accept-encodings=utf-8,utf-16``, or put it in your config file, e.g.:.. code-block:: ini
[flake8]
accept-encodings = utf-8,utf-16``no-accept-encodings``
~~~~~~~~~~~~~~~~~~~~~~~If activated, this disallows all ``coding:`` magic comments, no matter their
encoding. This might be useful for Python 3 projects where UTF-8 is the default
and you don't want other encodings used in your project.You can pass this as a command-line argument to ``flake8``, e.g.
``--no-accept-encodings``, or put it in your config file, e.g.:.. code-block:: ini
[flake8]
no-accept-encodings = TrueRules
-----C101 Coding magic comment not found
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~No magic encoding comment was found in the file. As per
`PEP-263 `_, this must be in the
first two lines of the file.C102 Unknown encoding found in coding magic comment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The encoding found in the magic encoding comment did not match the
``accept-encodings`` option.C103 Coding magic comment present
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~``no-accept-encodings`` is set, and a magic encoding comment was found in the
file.Requirements
-------------* Python 2.7, 3.4
* flake8License
--------Apache License 2.0