Skip to main content
https://travis-ci.org/tk0miya/flake8-coding.svg?branch=master https://coveralls.io/repos/tk0miya/flake8-coding/badge.png?branch=master Code Climate

Adds 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:

$ 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 Darwin

Options

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.:

[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.:

[flake8]
no-accept-encodings = True

Rules

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.3, 3.4

  • flake8

License

Apache License 2.0

Release files for flake8-coding 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-coding 1.3.0
File Size Uploaded
flake8-coding-1.3.0.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-coding 1.3.0
File Interpreter ABI Platform
flake8_coding-1.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size:12.6 kB

Release files / flake8-coding-1.3.0.tar.gz

Download URL flake8-coding-1.3.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba01e96f879377766a3d71f3499a832b19386ce4831270bfe671ab57d0fe50be
BLAKE2b-256 checksum
How to use checksums
ae263c6304d646f8ee27d6c40bfcd9874fea870098c3ef3cf60e284ea9db29ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / flake8_coding-1.3.0-py2.py3-none-any.whl

Download URL flake8_coding-1.3.0-py2.py3-none-any.whl
Size 5.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
725d51e270aa990f568b6197204b17b87271a4e34da4e2412f7e38d298d0cdad
BLAKE2b-256 checksum
How to use checksums
fc02f2760b030dc2135105f57c045ad9b91d894c4e1aee4eb2475facc410b4e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.3.2

2 release files

1.3.1

2 release files

This release

1.3.0 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

1 release file

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page