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 usernameJIRA_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 removedJTC002- JIRA ticket not found
Supported Link Formats
The plugin finds links like:
https://your-company.atlassian.net/browse/PROJ-12345your-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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_jira_ticket_checker-0.1.2.tar.gz.
File metadata
- Download URL: flake8_jira_ticket_checker-0.1.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3128915daa8c9295f890bf312912b37783b97af40b75879b8646ec1c373e542f
|
|
| MD5 |
4520d93fc7c0d137908194c8f5c5974b
|
|
| BLAKE2b-256 |
3cf0aa870adb3654e5cdcdf211e4c3e4169ef091db290b0579468c0e06d4a35a
|
File details
Details for the file flake8_jira_ticket_checker-0.1.2-py3-none-any.whl.
File metadata
- Download URL: flake8_jira_ticket_checker-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6627eb6f5dab1a41433d6d875719fbbd7696ea8db6f3b2dffac0a2ae2fb3f4c
|
|
| MD5 |
bfff7417cbe2e826689c2364cadbf99e
|
|
| BLAKE2b-256 |
f061bb542f5cba202cda599cf9f1ae5d882635dd569b520a617f9eb94e9f23d1
|