Skip to main content

flake8 plugin which checks environment variable access against allowed patterns

Project description

flake8-env-patterns

flake8 plugin which validates access to environment variables against allowed patterns

installation

pip install flake8-env-patterns

flake8 codes

Code Description
FEP001 environment variable does not match any allowed pattern

rationale

flake8-env-patterns helps with enforcing a convention for environment variable names when building a python application.

configuration

This plugin expects a comma-separated list of regex patterns to validate environment variable access against. Patterns can be specified via --env-variable-patterns or as part of the flake8 configuration:

[flake8]
env-variable-patterns = AWS_.*,MYAPP_.*

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-env-patterns==0.2.0]
      args:
        - --env-variable-patterns
        - AWS_.*,MYAPP_.*

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-env-patterns-0.2.2.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

flake8_env_patterns-0.2.2-py3-none-any.whl (3.7 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