docs(tests): correct FileNotFoundError example message in tests/AGENTS.md#1002
docs(tests): correct FileNotFoundError example message in tests/AGENTS.md#10020xDevNinja wants to merge 1 commit intoTracer-Cloud:mainfrom
Conversation
…S.md
The example raises `FileNotFoundError("empty file not present: ...")`
but the guard above it is `if not os.path.exists(input_path)`, which
fires when the file is missing — not when it is empty. Update the message
to match the actual condition so contributor-facing guidance reads true.
Fixes Tracer-Cloud#828.
Closes Tracer-Cloud#861.
Greptile SummaryThis PR corrects a misleading error message in the Confidence Score: 5/5Safe to merge — one-line documentation correction with no functional impact. The change is a single error-message string in a documentation/example file. It corrects an inaccurate description to match the actual guard condition; there are no logic changes, no new code paths, and no risk to runtime behaviour. All remaining findings are P2 or lower, so the score is 5. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["extract_and_validate(input_path)"] --> B{os.path.exists?}
B -- "False (file missing)" --> C["raise FileNotFoundError\n'input file not found: {input_path}'"]
B -- "True" --> D["return data"]
Reviews (1): Last reviewed commit: "docs(tests): correct FileNotFoundError e..." | Re-trigger Greptile |
|
Heads up that #1004 was opened ~1 hour after this one and is fixing the same line. Your wording ("not found") feels more idiomatic to me, matching the FileNotFoundError convention, but happy to defer. cc @davincios / @VaibhavUpreti for the call on which one to merge. |
|
this has beed fixed, closing this @0xDevNinja @hamzzaaamalik |
Fixes #828.
Closes #861.
Describe the changes you have made in this PR -
tests/AGENTS.mdshows a "Separation of Concerns" example whose error message contradicts the guard above it:The guard fires when the file is missing, not when it is empty, so the message misleads contributors who copy the snippet as a template for their own use-case modules. This PR rewords the message to match the actual condition (
f"input file not found: {input_path}") and leaves the surrounding guidance untouched.Same fix as the duplicate report in #861, so closing that one in this PR.
Demo/Screenshot for feature changes and bug fixes -
Diff:
Local quality gate (clean tree, run from
make):make lint—All checks passed!make format-check—904 files already formattedmake typecheck—Success: no issues found in 391 source filesmake test-cov—3314 passed, 2 skipped, 1 xfailedCode Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
Explain your implementation approach:
The example sits inside
tests/AGENTS.mdas contributor-facing guidance for splitting pure business logic from test orchestration. The conditionif not os.path.exists(input_path)is the canonical missing-file guard, so the message has to read like a missing-file message ("input file not found: ...") rather than the original empty-file phrasing. I kept the surrounding pattern, the variable name, and the anti-pattern callout intact so the doc still teaches the same separation-of-concerns lesson; only the literal message text changed.Checklist before requesting a review