A plugin for flake8 that performs conditional FIXME/TODO checks.
Project description
flake8-action-hero
A plugin for flake8 that performs conditional FIXME/TODO checks.
Action Tags
Code comments that begin with # FIXME:
/# TODO:
are often referred to as "FIXME Comments". This plugin refers to them as action tags.
Action tags are typically a tag followed by a series of commands and variables. The series is defined by the module (action) handling the conditional test defined in sections below.
The parser for action tags attempts to be fairly flexible and allow for the following:
# This will be ignored since there is no action.
# FIXME: This is a bare fixme comment.
# TODO: This is a bare todo comment.
# This will be ignored since there is no action.
# FIXME(SRS): This comment includes my initials and is a popular way to signify that a
# person found an issue (and isn't directly responsible for fixing it).
# This will be tested since there is a valid action.
# FIXME(SRS): DATE: AFTER: 2022-01-01: This comment includes initials as well as a composite
# action and condition and will be tested.
# This will be ignored since no action handler exists (yet) for this.
# CRITICAL: SCHRÖDINGER: CAT: DEAD: Do not commit while cat is dead.
Date Conditional Action Tags
Examples:
# FIXME: DATE: AFTER: 2021-12-05: This will result in code `AH000: Date conditional action tag found (FIXME)
Package Conditional Action Tags
Package conditional action tags attempt to locate and verify that a locally installed package is contained within a standard python packaging specifier. This provides a utility to tag an area of code that may need to be refactored when a package is released (and locally available) that may contain a feature needed to bring in new functionality or prompt the need to refactor or remove a bugfix fixed upstream.
Examples:
# FIXME: PACKAGE: VERSION: aws-lambda-powertools>=0.19.0: New feature should remove following bandaid code.
# TODO: PACKAGE: VERSION: bungee-jump>=1.29: Can now jump with blindfold. Add in new feature for blindfold jump.
# CRITICAL: PACKAGE: VERSION: orm-uber-tool>=2.12.0,<=2.12.5: Bug introduced in module will cause CPU to smoke. Danger.
Utilizing this tag requires that following dependencies:
packaging
: Developed by PyPa team and used in order to test a version against a specifier.importlib_metadata
: Developed by Python team and used in order to find the most relevant installed package version within your python environment.
Error Codes
In the error code table the {T}
/{...}
represents a code and type related to the comment tag. While 10 might be a short list it is most likely considered too long in most standards. This project has opted to add in a few extras that don't directly overlap with other fixme related checkers as a way to offer some extended workflow and alerting functionality.
Code {T} |
Type {...} |
Description |
---|---|---|
0 |
FIXME |
... |
1 |
TODO |
... |
2 |
XXX |
... |
3 |
BUG |
... |
4 |
REFACTOR |
... |
5 |
REMOVEME |
... |
6 |
LEGACY |
... |
7 |
CRITICAL |
... |
8 |
WARNING |
... |
Error codes | Description | Utility |
---|---|---|
AH00{T} |
Date after condition met ({...} ) |
Good for tracking feature dates. |
AH01{T} |
Date before condition met ({...} ) |
Perhaps not very useful. |
AH40{T} |
Package version specifier condition met ({...} ) |
Refactoring against upstream changes. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flake8-action-hero-0.1.1.tar.gz
.
File metadata
- Download URL: flake8-action-hero-0.1.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.10 Linux/5.10.43.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d6783a51b7274fd6fb625b5be17668229f2ee3180c34206c294ddd1842f3289 |
|
MD5 | a336eec322a662e97180b1a2ad84c614 |
|
BLAKE2b-256 | 101563179d7654d6664415562ba30950d24c338c0b3bb4ffbcc6594f2b7db835 |
File details
Details for the file flake8_action_hero-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: flake8_action_hero-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.10 Linux/5.10.43.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e24616f0c18512da7c45a1718cbe1503540f9997e14e290cfdfd66070fa5200 |
|
MD5 | 5e284355f963279baf202f532459c3d0 |
|
BLAKE2b-256 | 5b27a8fbd8755a78d1b288838644f6897b5890e0f5097296337dade702ae09ad |