Skip to content

Add colour to vulture CLI output - #415

Open
hugovk wants to merge 2 commits into
jendrikseipp:mainfrom
hugovk:main
Open

Add colour to vulture CLI output#415
hugovk wants to merge 2 commits into
jendrikseipp:mainfrom
hugovk:main

Conversation

@hugovk

@hugovk hugovk commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Description

https://github.com/albertas/deadcode has colour output, but is unmaintained and doesn't support Python 3.14.

This PR adds colour to vulture's CLI output to make it easier to read:

image

This uses a colour scheme similar to flake8, so will be familiar to people.

It adds a -c, --color {yes,no,auto} option, defaulting to auto.

It uses the termcolor library, which disables colour when not in a TTY, so piped output has no ANSI codes. It also respects common env vars such as NO_COLOR=1 and FORCE_COLOR=1: https://github.com/termcolor/termcolor#overrides

Related Issue

Checklist:

  • I have updated the documentation in the README.md file or my changes don't require an update.
  • I have added an entry in CHANGELOG.md.
  • I have added or adapted tests to cover my changes.
  • I have run pre-commit run --all-files to format and lint my code.

@codecov

codecov Bot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.52%. Comparing base (81fb2ac) to head (6fcc1a6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
vulture/config.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #415      +/-   ##
==========================================
+ Coverage   93.46%   93.52%   +0.06%     
==========================================
  Files           9        9              
  Lines         597      618      +21     
==========================================
+ Hits          558      578      +20     
- Misses         39       40       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant