Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-action-hero-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

flake8_action_hero-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file flake8-action-hero-0.1.0.tar.gz.

File metadata

  • Download URL: flake8-action-hero-0.1.0.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

Hashes for flake8-action-hero-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5f69fa495ebcdce66ed5cdb74aed330825502a93ce42620af5324e3240e0826
MD5 7f910ed5c97d1b98ce2064831816a29d
BLAKE2b-256 1c0636bb273b032e7c0b84727158eac233650ed598293b400579407c1d95311d

See more details on using hashes here.

File details

Details for the file flake8_action_hero-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flake8_action_hero-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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

Hashes for flake8_action_hero-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65d1347a16b8e3fc05e79b739392e7a4c7c8c824ee7bac369e6ea3c96e8e1082
MD5 29f6ffeb2ec2179c3405c964b26a5756
BLAKE2b-256 6378e6a36141014415d211d3191613df73af3cc933f3f4294d90d6e010fbed81

See more details on using hashes here.

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