mirror of
https://github.com/alirezarezvani/claude-skills.git
synced 2026-08-28 04:24:58 +00:00
refactor(tooling): PR #841 round-3 review — uniform --sample precedence + warnings
- health_score_calculator + pipeline_analyzer: warn on stderr when --sample overrides a provided input (now consistent across all six tools) - pmf_scorer: --sample checked before --input (matches the batch), with the same override warning - pipeline_analyzer: comment the intentionally stale D-3 fixture deal - contrast_checker: user-facing --sample help text https://claude.ai/code/session_01CUWsrUNZP9jpxvAwq67UiT
This commit is contained in:
parent
0cc9ef05e5
commit
552b373bef
4 changed files with 13 additions and 4 deletions
|
|
@ -444,6 +444,8 @@ def main() -> None:
|
|||
args = parser.parse_args()
|
||||
|
||||
if args.sample:
|
||||
if args.input_file:
|
||||
print("Warning: --sample specified; ignoring input_file", file=sys.stderr)
|
||||
data = SAMPLE_DATA
|
||||
else:
|
||||
if not args.input_file:
|
||||
|
|
|
|||
|
|
@ -458,6 +458,8 @@ SAMPLE_DATA = {
|
|||
"value": 120000, "age_days": 30, "close_date": "2026-07-15"},
|
||||
{"id": "D-2", "name": "Globex new logo", "stage": "discovery",
|
||||
"value": 80000, "age_days": 10, "close_date": "2026-08-01"},
|
||||
# D-3 is intentionally stale (70d old vs 45d average cycle, closing
|
||||
# imminently) so the fixture exercises the at-risk/aging detection.
|
||||
{"id": "D-3", "name": "Initech expansion", "stage": "negotiation",
|
||||
"value": 200000, "age_days": 70, "close_date": "2026-06-30"},
|
||||
{"id": "D-4", "name": "Umbrella upsell", "stage": "closed_won",
|
||||
|
|
@ -490,6 +492,8 @@ def main() -> None:
|
|||
args = parser.parse_args()
|
||||
|
||||
if args.sample:
|
||||
if args.input:
|
||||
print("Warning: --sample specified; ignoring --input", file=sys.stderr)
|
||||
data = SAMPLE_DATA
|
||||
else:
|
||||
if not args.input:
|
||||
|
|
|
|||
|
|
@ -563,7 +563,12 @@ def main():
|
|||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.input:
|
||||
if args.sample:
|
||||
# --sample wins over --input, consistent with the other sample-pattern tools.
|
||||
if args.input:
|
||||
print("Warning: --sample specified; ignoring --input", file=sys.stderr)
|
||||
data = sample_data()
|
||||
elif args.input:
|
||||
try:
|
||||
with open(args.input) as f:
|
||||
data = json.load(f)
|
||||
|
|
@ -573,8 +578,6 @@ def main():
|
|||
except json.JSONDecodeError as e:
|
||||
print(f"Error: invalid JSON: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
elif args.sample:
|
||||
data = sample_data()
|
||||
else:
|
||||
# Notice goes to stderr so `--json` output stays parseable when piped.
|
||||
print("No input file provided — running with sample data.\n", file=sys.stderr)
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|||
parser.add_argument(
|
||||
"--sample",
|
||||
action="store_true",
|
||||
help="Alias for --demo (repo-wide embedded-sample convention)",
|
||||
help="Run with embedded sample color pairs (alias for --demo)",
|
||||
)
|
||||
return parser
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue