Skip to main content

Flake8 __author__ checker

Project description

Build Status PyPI Version

flake8-author is a Flake8 extension that checks Python modules for module-level __author__ attributes.

There is no official standard on __author__ usage. It is used largely by convention. Guido had this to say back in 2001:

Anothor source of discomfort is that there’s absolutely no standard for this kind of meta-data variables. We’ve got __version__, and I believe we once agreed on that (in 1994 or so :-). But __author__? __credits__? What next – __cute_signoff__?

This extension can therefore be configured to explicitly require or forbid __author__ attributes. By default, __author__ is considered optional.

If the __author__ attribute is allowed, it’s value can also be validated using a configurable pattern.

Installation

Install from PyPI using pip:

pip install flake8-author

The extension will be activated automatically by flake8. You can verify that it has been loaded by inspecting the flake8 --version string.

$ flake8 --version
2.5.4 (pep8: 1.7.0, pyflakes: 0.8.1, author: 1.0.0, mccabe: 0.3.1) CPython 2.7.11 on Darwin

Error Codes

This extension adds three new warnings (using the A40 prefix):

  • A400: a module-level __author__ attribute is required

  • A401: __author__ attributes are not allowed

  • A402: __author__ attribute value does not match pattern

Configuration

Configuration values are specified in the [flake8] section of your config file or as command line arguments (e.g. --author-attribute=required).

  • author-attribute: “optional”, “required”, “forbidden” (default: optional)

  • author-pattern: __author__ validation pattern (default: .*)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-author-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file flake8-author-1.0.0.tar.gz.

File metadata

File hashes

Hashes for flake8-author-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b62006bc69a85519109ad165f8330fde6ddaed3e3eb0e3479fe8eaf157d3be32
MD5 7b2581f07940fbeed154cc182d67415b
BLAKE2b-256 ddee7536d44cb8d6a1fb7d97c40f3744e0f065e07ee08dfc54952076fe7b332a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page