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/RESOLVED 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, RESOLVED

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.0.tar.gz (7.3 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for flake8_jira_ticket_checker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 86f25d2a2bcdd359480ccdec3bded72ebed8debab3c9ad884e0cbed960d83040
MD5 3a16810bafa273996ea93e0e093a0d55
BLAKE2b-256 c2aeadd5bce463f18a3a692458d5e14e336bb376a14ba3b5d56a52ff79b85802

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