Skip to main content

Flake8 plugin to check JIRA ticket status

Project description

JIRA Ticket Checker Plugin for Flake8

A Flake8 plugin for checking JIRA ticket status in your codebase.

Features

  • Find JIRA ticket links anywhere in code (not just in TODO comments)
  • Check ticket status via JIRA API
  • Authentication via environment variables
  • Configurable timeout (default 1 second)
  • Proper connection error handling

Environment Variables

The plugin requires the following environment variables:

  • JIRA_USERNAME - your JIRA username
  • JIRA_TOKEN - JIRA API token (recommended)
  • JIRA_PASSWORD - JIRA password (alternative to token, less secure)
  • JIRA_BASE_URL - your JIRA server URL (e.g., https://your-company.atlassian.net)
  • JIRA_TIMEOUT - connection timeout in seconds (optional, default: 1)

Usage in CI

export JIRA_USERNAME="your.username@company.com"
export JIRA_TOKEN="your_api_token"
export JIRA_BASE_URL="https://your-company.atlassian.net"
export JIRA_TIMEOUT="3"  # Optional: 3 seconds timeout
flake8 --select=JTC path/to/your/code

Configuration

You can also configure the plugin via setup.cfg:

[flake8]
jira_base_url = https://your-company.atlassian.net
jira_checker_silent = false
jira_timeout = 3

Error Codes

  • JTC001 - JIRA ticket is in DONE/CLOSED status and should be removed
  • JTC002 - JIRA ticket not found

Supported Link Formats

The plugin finds links like:

  • https://your-company.atlassian.net/browse/PROJ-12345
  • your-company.atlassian.net/browse/TEST-123
  • In comments, strings, URLs, etc.

Ticket Status

Tickets are considered closed if their status is: DONE, CLOSED

Configuration Options

Silent Mode

You can suppress warnings by setting:

  • Environment variable: JIRA_CHECKER_SILENT=true
  • In setup.cfg: jira_checker_silent = true

Timeout

You can configure the JIRA API connection timeout:

  • Environment variable: JIRA_TIMEOUT=5 (in seconds)
  • In setup.cfg: jira_timeout = 5 (in seconds)
  • Default: 1 second

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_jira_ticket_checker-0.1.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_jira_ticket_checker-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file flake8_jira_ticket_checker-0.1.2.tar.gz.

File metadata

File hashes

Hashes for flake8_jira_ticket_checker-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3128915daa8c9295f890bf312912b37783b97af40b75879b8646ec1c373e542f
MD5 4520d93fc7c0d137908194c8f5c5974b
BLAKE2b-256 3cf0aa870adb3654e5cdcdf211e4c3e4169ef091db290b0579468c0e06d4a35a

See more details on using hashes here.

File details

Details for the file flake8_jira_ticket_checker-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_jira_ticket_checker-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6627eb6f5dab1a41433d6d875719fbbd7696ea8db6f3b2dffac0a2ae2fb3f4c
MD5 bfff7417cbe2e826689c2364cadbf99e
BLAKE2b-256 f061bb542f5cba202cda599cf9f1ae5d882635dd569b520a617f9eb94e9f23d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page