You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both pre-commit-action/check-hooks-installed.py and shared-lints/check_cargo_lints.py assume their input files are well-formed. If a config file is malformed, the scripts raise unhandled exceptions instead of a clean failure message.
Motivation
Why is this change needed?
What is the benefit to users, maintainers, or performance?
Contributors fixing their .pre-commit-config.yaml or Cargo.toml should get a message that tells them what's wrong with their file, not an internal traceback.
This also makes failures easier to triage from CI logs alone.
Proposed Solution
Wrap the YAML/TOML parsing calls in try/except
On parse failure, print a clear [FAIL] message (consistent with existing output style) identifying which file failed and why, then exit 1
Add/extend test coverage for malformed-input cases
(Optional) Briefly describe your idea for how this could be solved.
You can also link to any relevant code, design documents, or references.
Additional Context
(Optional) Add any screenshots, related issues, or architectural concerns.
Important
Make sure to link this issue with the PR for your improvement.
Description
Both pre-commit-action/check-hooks-installed.py and shared-lints/check_cargo_lints.py assume their input files are well-formed. If a config file is malformed, the scripts raise unhandled exceptions instead of a clean failure message.
Motivation
Why is this change needed?
What is the benefit to users, maintainers, or performance?
Contributors fixing their .pre-commit-config.yaml or Cargo.toml should get a message that tells them what's wrong with their file, not an internal traceback.
This also makes failures easier to triage from CI logs alone.
Proposed Solution
(Optional) Briefly describe your idea for how this could be solved.
You can also link to any relevant code, design documents, or references.
Additional Context
(Optional) Add any screenshots, related issues, or architectural concerns.
Important
Make sure to link this issue with the PR for your improvement.