Skip to main content

Flake8 __author__ checker

Project description

Build Status PyPI Version Python Versions

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, its value can also be validated using a configurable regular expression 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
3.4.1 (author: 1.1.4, mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.5.0) CPython 2.7.13 on Darwin

Error Codes

This extension adds three new error codes (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 re pattern (default: '')

Changes

1.1.4 (2017-07-29)

  • Minor code and packaging cleanup.

1.1.3 (2017-07-28)

  • Drop the setup_requires dependency on flake8.

1.1.2 (2017-01-12)

  • Only apply the author regular expression pattern check when a pattern has actually been configured.

1.1.1 (2016-11-06)

  • Fix configuration file parsing for flake8 3.0+.

1.1.0 (2016-08-15)

  • Support flake8 3.0.0 (required for development)

1.0.2 (2016-06-02)

  • Support flake8 version 2.6.0

  • Drop test dependency on pytest (development only)

1.0.1 (2016-05-11)

  • Fixed parser validation for configuration-based options

1.0.0 (2016-04-30)

  • Initial release

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.1.4.tar.gz (5.7 kB view details)

Uploaded Source

Built Distributions

flake8_author-1.1.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

flake8_author-1.1.4-py2-none-any.whl (7.0 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for flake8-author-1.1.4.tar.gz
Algorithm Hash digest
SHA256 843b78805d60c9b2e9ba17f3950ff44b734967fbcffa25c0a1db0940a3ecedc4
MD5 b83f35b24631d5d48fb290dd0f3d82de
BLAKE2b-256 c2f6df6eb452ef0123513100a6629e7e334c964029d4bcbc8d3a57ff8d1e34dc

See more details on using hashes here.

Provenance

File details

Details for the file flake8_author-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_author-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b2416796aaafdb75984291166b62e52534bf228ceadb052aef80afeb8a7297f5
MD5 c9ad56a0ecfc98a53159dbd340825a15
BLAKE2b-256 087fafa6573d41d8120feb04e1e282756ef9455a01de917c6fd5364b8706b0d3

See more details on using hashes here.

Provenance

File details

Details for the file flake8_author-1.1.4-py2-none-any.whl.

File metadata

File hashes

Hashes for flake8_author-1.1.4-py2-none-any.whl
Algorithm Hash digest
SHA256 e980197a3d34ae884cafc4744e31e802c343be274eecc859ee114b7a748811ca
MD5 c184b0dad14814e89df486817e7543e6
BLAKE2b-256 5dc4389f7dd184867b55b4f720f6a085562dbb5f757a8450a5559c312ca61726

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