Metadata-Version: 2.1
Name: flake8-env-patterns
Version: 0.2.2
Summary: flake8 plugin which checks environment variable access against allowed patterns
Author-email: Felix Scherz <felixwscherz@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Felix Scherz
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: issues, https://github.com/felixwscherz/flake8-env-patterns/issues
Project-URL: repository, https://github.com/felixscherz/flake8-env-patterns
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flake8>=3.8
Requires-Dist: importlib-metadata; python_version < "3.10"

# 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:

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

## as a pre-commit hook

See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions.
Sample `.pre-commit-config.yaml`:

```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_.*
```
