Skip to main content

Flake8 Coding plugin

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

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.6, 2.7, 3.3, 3.4

  • flake8

License

Apache License 2.0

Metadata

Release files for flake8-coding 1.2.1

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.2.1
File Size Uploaded Provenance Actions
flake8-coding-1.2.1.tar.gz 7.3 kB Without provenance Details for flake8-coding-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 12.4 kB

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

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

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

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

Security for flake8-coding 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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