Skip to main content

Flake8 __author__ checker

Project description

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.

The __author__ attribute is generally assigned to a string, but multiple authors can be listed using a list (or tuple or set) of strings.

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
6.1.0 (author: 2.1.0, ...) CPython 3.11.5 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: '')

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_author-2.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file flake8_author-2.2.0.tar.gz.

File metadata

  • Download URL: flake8_author-2.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flake8_author-2.2.0.tar.gz
Algorithm Hash digest
SHA256 72504c616b4fb96826ee16e2c7be7e86f85eb9756d1afb10f84897ba28ed0005
MD5 53c74efafd184d58d33f596bdcdc6c61
BLAKE2b-256 952ad21c8a979d76c808e3d40b310b28f094b10d55d8d04093e996f8e557bddf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flake8_author-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flake8_author-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 183bd80499214334aefe2b6406f6b9a2389f75d43b05cc1ddadbbdb6f5dd3503
MD5 c87effa90cf3f418983276e4c2284e49
BLAKE2b-256 782d0ae1b6297ba435bb0f75ada60306fc67ec239c5006b303d68442eddd11cd

See more details on using hashes here.

Supported by

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