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

Đang mở
#578 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
66/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, shell
Lĩnh vực
testing, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
4
Fork
1
Merge trung bình
6 giờ 31 phút
Pull request đã merge (30 ngày)
238

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cpp-best-practices/project_validator

Tất cả issue của cpp-best-practices/project_validator

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.