Shell dead code and per-tool short info flags are no run

Open
#578 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
66/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python, shell
Domain
testing, tooling

Research direction

Start by reading the command detection and policy loading code, then inspect policy/inert_commands.toml and the existing fixtures or tests for constant-false conditions and info flags. Add cases for commands after exit and per-program -h and version entries; done means those cases are not credited as runs while tools where -h has another meaning remain credited.

Written by the indexing model from the issue text.

Description

Problem

  • if false; then ruff check .; fi and exit 0 before the tool are still credited. GitHub's if: false and Julia's if false are already handled (#499).
  • -h and a version subcommand were left out of #496 on purpose, since short flags mean different things to different tools. bats -h and cargo audit -h are still credited.

Expected

  • Commands under a constant-false shell condition, or after an unconditional exit, are not commands.
  • -h and version are info-only per program, as entries in [[programs]] in policy/inert_commands.toml, never globally.

Done when

Each case above is no run, and -h keeps its meaning for tools where it means something else.

Split from #476. Checked against main at 4b4dbb6c on 2026-12-03: the cases above were reproduced with small fixtures or found in the code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Dominant language
Python
Stars
4
Forks
1
Avg merge
6h 31m
Merged PRs (30d)
238

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cpp-best-practices/project_validator

All issues in cpp-best-practices/project_validator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.