Skip to main content

flake8 plugin to allowlist imports

Project description

flake8-allowlist-imports

PyPI - Version PyPI - Python Version


flake8 plugin which validates imports against an allowlist

installation

pip install flake8-allowlist-imports

flake8 codes

Code Description
FAI001 third party package is not allowed by the allowlist

rationale

flake8-allowlist-imports helps with constraining imports when building applications in a team

configuration

This plugin expects a comma-separated list of package names to allow. Packages can be specified via --import-allowlist or as part of the flake8 configuration:

[flake8]
import-allowlist = mypackage,requests

as a pre-commit hook

See pre-commit for instructions. Sample .pre-commit-config.yaml:

- repo: https://github.com/pycqa/flake8
  rev: 7.0.0
  hooks:
    - id: flake8
      additional_dependencies: [flake8-allowlist-imports==0.1.1]
      args:
        - --import-allowlist
        - mypackage,requests

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-allowlist-imports-0.1.2.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

flake8_allowlist_imports-0.1.2-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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