Skip to main content

Flake8 JIRA TODO Checker

CircleCI PyPI PyPI PyPI PyPI

Flake8 plugin to check that:

  1. Every TODO comment has a JIRA ID next to it.
  2. Every JIRA ID refers to a JIRA issue which is not closed.
  3. All "TODO" comments use the word "TODO" ("FIXME", "QQ", etc are not allowed).

In other words, this is valid as long as the JIRA issue ABC-123 is not closed:

def hacky_function():
    # TODO ABC-123 Stop reticulating splines
    ...

However, none of these comments would be valid:

def hacky_function():
    # TODO No JIRA issue is attached here
    # TODO ABC-9182 Not valid if this JIRA issue is resolved!
    # TODO FIXME You can't use this word to denote a TODO
    ...

You can choose to run this project without connectivity to JIRA, in which case it will only check that every TODO has an issue attached from the correct project.

Configuration

jira-project-ids

A list of valid JIRA project IDs can be provided via the flag --jira-project-ids or via the key jira-project-ids in a flake8 configuration file, e.g.

jira-project-ids = ABC,DEF

If no project IDs are provided then all TODOs will be rejected.

todo-synonyms

A list of words which will be treated like TODO can be provided via the flags --allowed-todo-synonyms and --disallowed-todo-synonyms or via the key allowed-todo-synonyms and disallowed-todo-synonyms in a flake8 configuration file.

disallowed-todo-synonyms will raise an error whenever found in the codebase, and allowed-todo-synonyms will raise an error only if it's missing a JIRA card or that JIRA card is invalid.

Defaults to:

allowed-todo-synonyms = TODO
disallowed-todo-synonyms = FIXME,QQ

jira-server

The URL of the JIRA server, if unset the status of JIRA cards won't be checked.

disallowed-jira-statuses, disallowed-jira-resolutions, and disallow-all-jira-resolutions

If a TODO is attached to a JIRA issue whose status is in disallowed-jira-statuses then an error will be reported, ditto if the JIRA card has a resolution in disallowed-jira-resolutions. If disallow-all-jira-resolutions is set to True, then report an error if issue has any resolution.

Defaults to:

disallowed-jira-statuses = Done
disallow-all-jira-resolutions = True

JIRA Authentication

We support the same authentication methods as the jira-python library.

For cookie-based username/password authentication, use the following configuration parameters:

  1. jira-cookie-username
  2. jira-cookie-password

For HTTP Basic username/password authentication, use the following configuration parameters:

  1. jira-http-basic-username
  2. jira-http-basic-password

For JIRA cloud set jira-http-basic-username to your email address and jira-http-basic-password to your API token.

For OAuth authentication, use the following configuration parameters:

  1. jira-oauth-access-token
  2. jira-oauth-access-token-secret
  3. jira-oauth-consumer-key
  4. jira-oauth-key-cert-file

For kerberos authentication, set the jira-kerberos configuration parameter to True.

Alternatives

This project is heavily inspired by the Softwire TODO checker.

Licence

GNU General Public License v3 or later (GPLv3+)

Development Setup

  1. Install pyenv
  2. Install poetry
  3. poetry install

Releasing

  1. poetry run bump2version minor
  2. git push && git push --tags
  3. tox -e pypi

Metadata

Release files for flake8-jira-todo-checker 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-jira-todo-checker 0.6.1
File Size Uploaded
flake8-jira-todo-checker-0.6.1.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-jira-todo-checker 0.6.1
File Interpreter ABI Platform
flake8_jira_todo_checker-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.2 kB

Release files / flake8-jira-todo-checker-0.6.1.tar.gz

Download URL flake8-jira-todo-checker-0.6.1.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b44973733f807401083966974f7c519b62d7ef33922a0ee0997e91094f90faac
BLAKE2b-256 checksum
How to use checksums
f6877af48085f5af7c1672dbda61eec3b983140bb22ce8482f5b55de946bfe98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.8.10 Linux/5.13.0-27-generic

Release files / flake8_jira_todo_checker-0.6.1-py3-none-any.whl

Download URL flake8_jira_todo_checker-0.6.1-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d8d25b58a546393de96b635b1a448dcdf281739d6e3f08d232b827e1aaede71
BLAKE2b-256 checksum
How to use checksums
544439e63eebeb7e79da4b562f48685b0ce768a54b12d6bc79d74fdf08429f5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.8.10 Linux/5.13.0-27-generic

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page