Internals

Extension

Flake8 extension for checking author, copyright, and license.

author:Joe Joyce <joe@decafjoe.com>
copyright:Copyright (c) Joe Joyce and contributors, 2016-2019.
license:BSD
flake8_ownership.__version__ = '2.0.2'

Version of the extension.

Type:str
flake8_ownership.author_re

Regex that matches the :author: line.

Type:re
flake8_ownership.copyright_re

Regex that matches the :copyright: line.

Type:re
flake8_ownership.license_re

Regex that matches the :license: line.

Type:re
class flake8_ownership.Checker(tree, filename)[source]

Flake8 checker class that checks for author, copyright, and license.

classmethod add_options(parser)[source]

Add –author-re, –copyright-re, and –license-re options.

author_re = None

List of regexes of valid :author: values.

Type:list of re instances.
codes = 'O10'

Prefix for the error codes emitted from this class.

Type:str
copyright_re = None

List of regexes of valid :copyright: values.

Type:list of re instances.
license_re = None

List of regexes of valid :license: values.

Type:list of re instances.
name = 'flake8_ownership'

Name of the checker.

Type:str
classmethod parse_options(options)[source]

Process the supplied configuration.

This populates the author_re, copyright_re, and license_re attributes. For each configuration option, this substitutes <COMMA> and <YEAR> as appropriate, then compiles each regex.

run()[source]

Run the Checker on a filename.

version = '2.0.2'

Version of the checker.

Type:str

Tests