Conversation
📝 Changelog ReminderThis PR does not appear to update If this PR includes user-facing changes, please consider adding an entry to the changelog under the appropriate section:
You can skip this reminder by adding one of these labels: When is a changelog entry needed?A changelog entry is typically needed for:
A changelog entry is typically NOT needed for:
This is an automated reminder. The PR will not be blocked by this check. |
There was a problem hiding this comment.
Pull request overview
Aligns local tooling + CI linting with mutation-testing expectations by linting feature-gated code (tokio,json) and preventing accidental #[track_caller] usage on async fn (which is ineffective / error-prone depending on toolchain).
Changes:
- Run clippy with
--features tokio,jsonin CI and local wrappers/aliases/docs so feature-gated code is linted. - Add a pre-commit hook to detect
#[track_caller]onasync fn. - Remove
#[track_caller]from an async test helper and document why.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/network/tokio_socket.rs |
Removes #[track_caller] from an async helper and documents rationale. |
scripts/run-cargo-clippy.py |
Pre-commit clippy wrapper now enables tokio,json features. |
scripts/hooks/check-track-caller-async.py |
New pre-commit hook to catch #[track_caller] on async fn. |
CLAUDE.md |
Updates pre-commit command guidance to include features. |
.pre-commit-config.yaml |
Registers the new check-track-caller-async hook. |
.llm/skills/rust-pitfalls.md |
Documents the #[track_caller] + async pitfall and checklist item. |
.llm/skills/refactoring.md |
Updates refactoring clippy commands to include features. |
.llm/skills/ci-debugging.md |
Updates clippy debugging commands to include features. |
.llm/skills/async-rust.md |
Adds #[track_caller] on async fn to async pitfalls table. |
.llm/context.md |
Updates canonical quick commands / linting guidance to include features. |
.github/workflows/ci-safety.yml |
Runs strict clippy and panic/unwrap checks with tokio,json enabled. |
.github/workflows/ci-rust.yml |
Runs clippy with tokio,json enabled. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates contributor checklist clippy command to include features. |
.devcontainer/welcome.sh |
Updates displayed clippy command to include features. |
.cursorrules |
Updates quick command snippet to include features. |
.cargo/config.toml |
Updates cargo c alias to run clippy with tokio,json features. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Aligns linting/CI and local developer workflows to better cover feature-gated Rust code (tokio/json) and prevents a known Rust pitfall (#[track_caller] on async fn) via a new pre-commit hook.
Changes:
- Add a pre-commit hook to detect
#[track_caller]applied toasync fn, plus unit tests for the hook. - Update clippy invocations (wrapper script, docs, CI workflows, and cargo alias) to run with
--features tokio,json. - Remove
#[track_caller]from anasync fntest helper and document why.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] from async helper and documents the rationale. |
| scripts/hooks/check-track-caller-async.py | New pre-commit hook to flag #[track_caller] on async fn. |
| scripts/tests/test_check_track_caller_async.py | Unit tests covering same-line and lookahead detection behavior for the new hook. |
| scripts/run-cargo-clippy.py | Ensures clippy runs with --features tokio,json and -D warnings. |
| .pre-commit-config.yaml | Registers the new hook in the local pre-commit suite. |
| .cargo/config.toml | Updates cargo c alias to include --features tokio,json. |
| .github/workflows/ci-rust.yml | Runs clippy in CI with --features tokio,json. |
| .github/workflows/ci-safety.yml | Runs clippy checks in CI with --features tokio,json. |
| .llm/context.md | Updates canonical quick commands/linting guidance to include feature flags. |
| .llm/skills/rust-pitfalls.md | Documents the #[track_caller] + async fn pitfall and the hook. |
| .llm/skills/async-rust.md | Adds the pitfall to the async guidance table. |
| .llm/skills/refactoring.md | Updates refactoring checklists to run clippy with features. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction commands to include features. |
| CLAUDE.md | Updates pre-commit command guidance to include features. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates contributor checklist clippy command to include features. |
| .devcontainer/welcome.sh | Updates displayed clippy command to include features. |
| .cursorrules | Updates quick command snippet to include features. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR updates CI/pre-commit tooling to better lint feature-gated Rust code (tokio/json) and prevents misuse of #[track_caller] on async fn via a new pre-commit hook, along with supporting docs updates.
Changes:
- Add a pre-commit hook (
check-track-caller-async) plus unit tests to detect#[track_caller]applied toasync fn. - Standardize clippy invocations to include
--features tokio,jsonacross scripts, CI, and developer documentation. - Remove
#[track_caller]from an async test helper and document why.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/network/tokio_socket.rs |
Removes #[track_caller] from an async helper in tests and documents the rationale. |
scripts/hooks/check-track-caller-async.py |
Adds a new grep-based pre-commit hook to flag #[track_caller] on async functions. |
scripts/tests/test_check_track_caller_async.py |
Adds pytest unit tests covering same-line and lookahead detection behavior for the new hook. |
scripts/run-cargo-clippy.py |
Runs clippy with --features tokio,json to lint feature-gated code in pre-commit. |
.pre-commit-config.yaml |
Registers the new check-track-caller-async hook for Rust files. |
.github/workflows/ci-rust.yml |
Updates CI clippy to include --features tokio,json. |
.github/workflows/ci-safety.yml |
Updates CI clippy invocations (incl. safety/nursery lint runs) to include --features tokio,json. |
.cargo/config.toml |
Updates the cargo c alias to run clippy with --features tokio,json. |
.llm/context.md |
Updates documented “quick commands”/linting requirements to include --features tokio,json. |
CLAUDE.md |
Updates the pre-commit command guidance to include --features tokio,json. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates the checklist command to include --features tokio,json. |
.devcontainer/welcome.sh |
Updates displayed linting command to include --features tokio,json. |
.cursorrules |
Updates the quick command snippet to include --features tokio,json. |
.llm/skills/scripting.md |
Adds/clarifies lint-script error reporting guidance (path:line formatting and “violation site”). |
.llm/skills/rust-pitfalls.md |
Documents the #[track_caller] + async fn pitfall and references the new hook. |
.llm/skills/async-rust.md |
Adds the #[track_caller] on async fn pitfall to the async guide table. |
.llm/skills/refactoring.md |
Updates refactoring checklists/commands to use --features tokio,json for clippy. |
.llm/skills/ci-debugging.md |
Updates CI debugging guidance to reproduce clippy with --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR tightens CI/pre-commit behavior around mutation-testing-related failures by standardizing lint script output (stderr), ensuring clippy lints feature-gated code, and adding a new pre-commit hook + tests to prevent #[track_caller] usage on async fn.
Changes:
- Add a pre-commit hook (
check-track-caller-async) plus unit tests to detect#[track_caller]onasync fn, and remove the attribute from an async test helper. - Update clippy invocations/docs/CI to run with
--features tokio,jsonso feature-gated code is linted. - Standardize multiple hook scripts and their tests to emit failure information to
stderr, and expand CI docs workflow to run allscripts/tests/.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] from an async test helper and documents why. |
| scripts/hooks/check-track-caller-async.py | New pre-commit hook to detect #[track_caller] on async functions. |
| scripts/tests/test_check_track_caller_async.py | Adds unit tests for the new check-track-caller-async hook. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json to lint feature-gated code. |
| .cargo/config.toml | Updates the cargo c alias to include --features tokio,json. |
| .github/workflows/ci-rust.yml | Updates CI clippy step to include --features tokio,json. |
| .github/workflows/ci-safety.yml | Updates clippy invocations and guidance to include --features tokio,json. |
| .pre-commit-config.yaml | Adds the check-track-caller-async hook. |
| .github/workflows/ci-docs.yml | Broadens path triggers to scripts/** and runs all scripts/tests/ in CI. |
| scripts/hooks/check-llm-line-limit.py | Prints failures to stderr. |
| scripts/tests/test_check_llm_line_limit.py | Updates assertions to expect stderr output. |
| scripts/hooks/trailing-whitespace.py | Emits read warnings to stderr. |
| scripts/hooks/mixed-line-ending.py | Emits read warnings to stderr. |
| scripts/hooks/end-of-file-fixer.py | Emits read warnings to stderr. |
| scripts/hooks/markdownlint.py | Emits “missing tool” messages to stderr. |
| scripts/hooks/check-yaml.py | Emits errors/warnings to stderr. |
| scripts/hooks/check-toml.py | Emits errors/warnings to stderr. |
| scripts/hooks/check-json.py | Emits errors/warnings to stderr. |
| scripts/hooks/check-merge-conflict.py | Emits errors/warnings to stderr and fails if file can’t be read. |
| scripts/hooks/check-empty-tests.py | Emits warnings/errors to stderr and returns a read-failure error string. |
| scripts/hooks/check-dockerfile.py | Emits output to stderr for CI-friendly reporting. |
| .llm/skills/scripting.md | Documents lint output format and violation-site line-number expectations. |
| .llm/skills/rust-pitfalls.md | Adds guidance about #[track_caller] on async fns. |
| .llm/skills/async-rust.md | Adds a pitfall entry for #[track_caller] on async fns. |
| .llm/skills/refactoring.md | Updates clippy commands to include feature flags. |
| .llm/skills/ci-debugging.md | Updates clippy reproductions to include feature flags. |
| .llm/context.md | Updates “mandatory linting” commands to include feature flags. |
| CLAUDE.md | Updates pre-commit command guidance to include feature flags. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates checklist clippy command to include feature flags. |
| .devcontainer/welcome.sh | Updates displayed clippy command to include feature flags. |
| .cursorrules | Updates quick command to include feature flags. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR standardizes and hardens the repo’s pre-commit/CI linting ecosystem by enforcing consistent {path}:{line}: {message} stderr output, expanding script-level test coverage for hooks, and ensuring clippy runs with feature-gated code enabled.
Changes:
- Added/expanded pre-commit hook scripts (including a new
#[track_caller]-on-async fnchecker) and updated several existing hooks to emit hyperlink-friendly stderr output with line numbers. - Added a suite of
pytestunit tests for multiple hook scripts and updated the docs CI workflow to run all script tests. - Updated clippy wrapper/config/docs to run
cargo clippy --all-targets --features tokio,jsonconsistently across local tooling and CI.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/network/tokio_socket.rs |
Removes #[track_caller] usage on an async helper and documents the rationale. |
scripts/tests/test_check_yaml.py |
Adds tests for YAML hook behavior and output format. |
scripts/tests/test_check_track_caller_async.py |
Adds tests covering same-line and lookahead detection for #[track_caller] on async fn. |
scripts/tests/test_check_toml.py |
Adds tests for TOML hook behavior and output format. |
scripts/tests/test_check_merge_conflict.py |
Adds tests for merge-conflict hook detection and output format. |
scripts/tests/test_check_llm_line_limit.py |
Updates tests to validate stderr + {path}:{line} formatting and adds output-format test cases. |
scripts/tests/test_check_json.py |
Adds tests for JSON/JSONC hook behavior and output format. |
scripts/tests/test_check_hook_output_format.py |
Adds tests for the new “hook output format” checker. |
scripts/tests/test_check_empty_tests.py |
Adds tests for empty-test detection hook and output format compliance. |
scripts/tests/test_check_dockerfile.py |
Adds output format tests for Dockerfile hook. |
scripts/run-cargo-clippy.py |
Runs clippy with --features tokio,json to lint feature-gated code in hooks/CI. |
scripts/hooks/trailing-whitespace.py |
Improves read-error reporting to stderr. |
scripts/hooks/regenerate-skills-index.py |
Sends “out-of-date”/write errors to stderr and improves read-error reporting. |
scripts/hooks/mixed-line-ending.py |
Improves read-error reporting to stderr. |
scripts/hooks/markdownlint.py |
Sends “tool missing” messages to stderr. |
scripts/hooks/end-of-file-fixer.py |
Improves read-error reporting to stderr. |
scripts/hooks/check-yaml.py |
Emits {path}:{line}: ... YAML errors to stderr and uses :0: for read errors. |
scripts/hooks/check-track-caller-async.py |
New hook to flag #[track_caller] on async fn with hyperlinkable output. |
scripts/hooks/check-toml.py |
Emits {path}:{line}: ... TOML errors to stderr and uses :0: for read errors. |
scripts/hooks/check-merge-conflict.py |
Emits {path}:{line}: ... conflict marker errors to stderr; fails on read errors. |
scripts/hooks/check-llm-line-limit.py |
Emits {path}:0: ... line-limit errors to stderr; uses :0: for read errors. |
scripts/hooks/check-json.py |
Emits {path}:{line}: ... JSON errors to stderr and uses :0: for read errors. |
scripts/hooks/check-hook-output-format.py |
New hook to enforce output-format conventions for hook scripts themselves. |
scripts/hooks/check-empty-tests.py |
Emits errors to stderr without leading whitespace; returns :0: read errors. |
scripts/hooks/check-dockerfile.py |
Emits issues to stderr without leading whitespace and uses :0: for read errors. |
CLAUDE.md |
Updates recommended clippy command to include --features tokio,json. |
.pre-commit-config.yaml |
Adds the new hook(s) and introduces hook-quality validation for hook scripts. |
.llm/skills/scripting.md |
Codifies lint-hook stderr output conventions and :0: handling. |
.llm/skills/rust-pitfalls.md |
Documents #[track_caller] on async fn as a Rust pitfall. |
.llm/skills/refactoring.md |
Updates clippy commands to include feature flags. |
.llm/skills/ci-debugging.md |
Updates clippy reproduction commands to include feature flags. |
.llm/skills/async-rust.md |
Adds #[track_caller] on async fn pitfall guidance. |
.llm/context.md |
Updates canonical “quick commands” and linting checklist to include feature flags for clippy. |
.github/workflows/ci-safety.yml |
Runs clippy with --features tokio,json (including strict lints). |
.github/workflows/ci-rust.yml |
Runs clippy with --features tokio,json. |
.github/workflows/ci-docs.yml |
Broadens script change triggers and runs all scripts/tests/ via pytest. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates clippy command in contributor checklist. |
.devcontainer/welcome.sh |
Updates displayed clippy command to include feature flags. |
.cursorrules |
Updates quick commands to include clippy feature flags. |
.cargo/config.toml |
Updates cargo c alias to include --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
| - id: check-track-caller-async | ||
| name: check track_caller on async fn | ||
| entry: python scripts/hooks/check-track-caller-async.py | ||
| language: python | ||
| types: [rust] | ||
|
|
There was a problem hiding this comment.
Pull request overview
This PR tightens and tests the repo’s pre-commit/CI “hook” ecosystem to make mutation/CI runs more reliable: standardizing hook error output, adding a new Rust-specific hook, and ensuring clippy runs with feature-gated code enabled.
Changes:
- Add/expand pytest coverage for multiple
scripts/hooks/*validators and their{path}:{line}: {message}stderr formatting. - Introduce a new
check-track-caller-asynchook and wire it into.pre-commit-config.yaml. - Standardize clippy invocations to include
--features tokio,jsonacross scripts, docs, and CI.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Remove #[track_caller] from an async test helper and document why. |
| scripts/run-cargo-clippy.py | Run clippy with --features tokio,json to cover feature-gated code. |
| scripts/hooks/trailing-whitespace.py | Emit read warnings to stderr with details. |
| scripts/hooks/regenerate-skills-index.py | Improve read/write error handling and send check-mode failures to stderr. |
| scripts/hooks/mixed-line-ending.py | Emit read warnings to stderr with details. |
| scripts/hooks/markdownlint.py | Print “tool missing / skipping” messages to stderr (not stdout). |
| scripts/hooks/end-of-file-fixer.py | Emit read warnings to stderr with details. |
| scripts/hooks/check-yaml.py | Standardize YAML error reporting to {path}:{line}: ... on stderr; handle decode errors. |
| scripts/hooks/check-track-caller-async.py | New hook to detect #[track_caller] applied to async fn. |
| scripts/hooks/check-toml.py | Standardize TOML error reporting to {path}:{line}: ... on stderr; handle decode errors. |
| scripts/hooks/check-merge-conflict.py | Standardize merge-conflict reporting format and fail on unreadable files. |
| scripts/hooks/check-llm-line-limit.py | Standardize output to {path}:{line}: ... on stderr (including :0: for file-level). |
| scripts/hooks/check-json.py | Standardize JSON error reporting to {path}:{line}: ... on stderr; handle decode errors. |
| scripts/hooks/check-hook-output-format.py | New meta-hook to enforce output formatting conventions in other hook scripts. |
| scripts/hooks/check-empty-tests.py | Standardize error printing to stderr without leading whitespace; fail on unreadable files. |
| scripts/hooks/check-dockerfile.py | Fail on unreadable files; print issues to stderr without leading whitespace. |
| scripts/tests/test_check_yaml.py | New unit tests for YAML hook behavior and output format. |
| scripts/tests/test_check_track_caller_async.py | New unit tests covering same-line and lookahead detection logic. |
| scripts/tests/test_check_toml.py | New unit tests for TOML hook behavior and output format. |
| scripts/tests/test_check_merge_conflict.py | New unit tests for merge-conflict detection and output format. |
| scripts/tests/test_check_llm_line_limit.py | Extend tests to validate stderr formatting and decode-error handling. |
| scripts/tests/test_check_json.py | New unit tests for JSON/JSONC validation, comment stripping, and output format. |
| scripts/tests/test_check_hook_output_format.py | New unit tests for the meta-hook checks (indent + missing line number). |
| scripts/tests/test_check_empty_tests.py | New unit tests for empty-test detection and output formatting. |
| scripts/tests/test_check_dockerfile.py | Extend tests for unreadable files and output formatting. |
| .pre-commit-config.yaml | Add check-track-caller-async and check-hook-output-format hooks. |
| .llm/skills/scripting.md | Document stderr + {path}:{line} conventions and read-error handling expectations. |
| .llm/skills/rust-pitfalls.md | Document #[track_caller] on async as a pitfall and mention the hook. |
| .llm/skills/refactoring.md | Update clippy commands to include --features tokio,json. |
| .llm/skills/ci-debugging.md | Update clippy reproduction commands to include --features tokio,json. |
| .llm/skills/async-rust.md | Add #[track_caller] on async pitfall entry. |
| .llm/context.md | Update canonical quick commands and linting checklist for clippy features. |
| CLAUDE.md | Update pre-commit instructions to include --features tokio,json. |
| .github/PULL_REQUEST_TEMPLATE.md | Update clippy checklist command to include --features tokio,json. |
| .devcontainer/welcome.sh | Update “Linting” hint to include --features tokio,json. |
| .cursorrules | Update quick commands to include --features tokio,json. |
| .cargo/config.toml | Update cargo c alias to run clippy with --features tokio,json. |
| .github/workflows/ci-safety.yml | Run clippy with --features tokio,json in safety jobs. |
| .github/workflows/ci-rust.yml | Run clippy with --features tokio,json in Rust CI. |
| .github/workflows/ci-docs.yml | Trigger docs workflow on any scripts/** change and run all scripts/tests/. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Updates the repo’s pre-commit hooks and CI to be more “fail-closed” and mutation-test friendly by standardizing hook error reporting, adding missing hook coverage tests, and ensuring clippy lints feature-gated code.
Changes:
- Standardize hook output/error handling (stderr +
{path}:{line}:+:0:for file-level errors) and add a hook to enforce these conventions. - Add/expand pytest coverage for hook scripts (including new
check-track-caller-asyncbehavior and multiple read/error edge cases). - Run clippy with
--features tokio,jsonacross docs/CI/dev tooling and documentation.
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] from an async test helper (replaced with rationale comment). |
| scripts/tests/test_trailing_whitespace.py | Adds unit tests for trailing-whitespace fixer behavior, errors, and output. |
| scripts/tests/test_mixed_line_ending.py | Adds unit tests for mixed-line-ending fixer behavior and failure modes. |
| scripts/tests/test_end_of_file_fixer.py | Adds unit tests for end-of-file fixer behavior and failure modes. |
| scripts/tests/test_check_yaml.py | Adds unit tests for YAML validation and output format compliance. |
| scripts/tests/test_check_track_caller_async.py | Adds extensive unit tests for the new async #[track_caller] checker. |
| scripts/tests/test_check_toml.py | Adds unit tests for TOML validation, line reporting, and read/encoding errors. |
| scripts/tests/test_check_merge_conflict.py | Adds unit tests for merge conflict detection and output format. |
| scripts/tests/test_check_llm_line_limit.py | Updates tests to assert stderr + {path}:{line}: formatting and read error handling. |
| scripts/tests/test_check_json.py | Adds unit tests for JSON/JSONC validation, comment stripping, and output format. |
| scripts/tests/test_check_hook_output_format.py | Adds unit tests for the new hook-output-format enforcement hook. |
| scripts/tests/test_check_empty_tests.py | Adds unit tests ensuring empty-test checker outputs correctly and fails closed on read errors. |
| scripts/tests/test_check_dockerfile.py | Updates tests for fail-closed read errors, non-duplicate output, and format compliance. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json to lint feature-gated code. |
| scripts/hooks/trailing-whitespace.py | Fixer now returns `bool |
| scripts/hooks/regenerate-skills-index.py | Prints read/decode errors with :0: formatting; minor stderr routing changes. |
| scripts/hooks/mixed-line-ending.py | Fixer now returns `bool |
| scripts/hooks/markdownlint.py | Routes “tool missing” messaging to stderr. |
| scripts/hooks/end-of-file-fixer.py | Fixer now returns `bool |
| scripts/hooks/check-yaml.py | Emits formatted stderr errors with line numbers; fail-closed on read/decode errors. |
| scripts/hooks/check-track-caller-async.py | New hook to detect #[track_caller] on async fn in Rust sources. |
| scripts/hooks/check-toml.py | Emits formatted stderr errors with line numbers; distinguishes decode vs parse vs OS errors. |
| scripts/hooks/check-merge-conflict.py | Emits formatted stderr output and fails closed when files can’t be read. |
| scripts/hooks/check-llm-line-limit.py | Emits formatted stderr output (:0:) and fails closed on read/decode errors. |
| scripts/hooks/check-json.py | Emits formatted stderr output with JSONDecodeError line numbers; fail-closed on read/decode errors. |
| scripts/hooks/check-hook-output-format.py | New meta-hook to enforce hook output format conventions in check-*.py scripts. |
| scripts/hooks/check-empty-tests.py | Fail-closed on read/decode errors; prints to stderr without leading indentation. |
| scripts/hooks/check-dockerfile.py | Fail-closed on read/decode errors; prints to stderr without leading indentation. |
| scripts/check-kani-coverage.py | Aligns read-error messaging with {path}:0: formatting to stderr. |
| CLAUDE.md | Updates pre-commit guidance to include clippy feature flags. |
| .pre-commit-config.yaml | Adds check-track-caller-async and check-hook-output-format; keeps hooks aligned with new behaviors. |
| .llm/skills/scripting.md | Documents enforced hook output/error-handling conventions and patterns. |
| .llm/skills/rust-pitfalls.md | Documents #[track_caller] on async fn pitfall and remediation. |
| .llm/skills/refactoring.md | Updates clippy command examples to include --features tokio,json. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction/debug commands to include features. |
| .llm/skills/async-rust.md | Adds guidance about #[track_caller] not being supported on async fns. |
| .llm/context.md | Updates canonical quick commands to run clippy with --features tokio,json. |
| .github/workflows/ci-safety.yml | Runs clippy with --features tokio,json in safety workflow steps. |
| .github/workflows/ci-rust.yml | Runs clippy with --features tokio,json in Rust CI workflow. |
| .github/workflows/ci-docs.yml | Broadens triggers to scripts/** and runs the full scripts/tests/ pytest suite. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates contributor checklist clippy command to include feature flags. |
| .devcontainer/welcome.sh | Updates displayed clippy command to include feature flags. |
| .cursorrules | Updates suggested clippy command to include feature flags. |
| .cargo/config.toml | Updates cargo c alias to include --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR tightens pre-commit / CI behavior around “mutation testing” failures by making hook scripts more fail-closed and output-format compliant, adding targeted hook test coverage, and ensuring Rust linting runs with feature-gated code enabled.
Changes:
- Add/expand pytest coverage for multiple
scripts/hooks/*checks/fixers and enforce{path}:{line}: ...output conventions. - Add new pre-commit hook to detect
#[track_caller]onasync fn, and remove the attribute from an async test helper. - Run
cargo clippywith--features tokio,jsonconsistently across scripts, docs, local aliases, and CI workflows.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] usage on an async helper, aligns with new async track-caller check. |
| scripts/tests/test_trailing_whitespace.py | New tests for trailing whitespace fixer behavior, including fail-closed errors and output expectations. |
| scripts/tests/test_regenerate_skills_index.py | New tests for skills index generation, metadata extraction, and fail-closed behavior on unreadable files. |
| scripts/tests/test_mixed_line_ending.py | New tests for line ending fixer behavior and error handling. |
| scripts/tests/test_end_of_file_fixer.py | New tests for EOF fixer behavior and error handling. |
| scripts/tests/test_check_yaml.py | New tests for YAML validation and output format (skip when PyYAML absent). |
| scripts/tests/test_check_track_caller_async.py | New tests for detecting #[track_caller] on async fns across multiple layouts and edge cases. |
| scripts/tests/test_check_toml.py | New tests for TOML validation, unicode/read errors, and output format (skip when TOML lib absent). |
| scripts/tests/test_check_merge_conflict.py | New tests for merge conflict marker detection and output format. |
| scripts/tests/test_check_llm_line_limit.py | Updates tests to assert stderr + {path}:{line} formatting and adds output-format checks. |
| scripts/tests/test_check_links.py | Adds tests ensuring anchor validation fails closed on unreadable/binary files. |
| scripts/tests/test_check_json.py | New tests for JSON/JSONC validation, comment stripping, and output format. |
| scripts/tests/test_check_hook_output_format.py | New tests for the hook-output-format linter (leading whitespace, missing :0:, Warning prefixes, duplicate output, fail-open patterns). |
| scripts/tests/test_check_empty_tests.py | New tests for empty-test detection hook + output formatting and no-duplicate-output behavior. |
| scripts/tests/test_check_dockerfile.py | Updates/extends tests to ensure Dockerfile checker fails closed on read errors and avoids duplicate stderr output. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json so feature-gated Rust is linted. |
| scripts/hooks/trailing-whitespace.py | Makes the fixer fail closed on read/decode errors and returns None on error for main-loop aggregation. |
| scripts/hooks/regenerate-skills-index.py | Fails closed on unreadable skill/index files, returns (content, had_error) from builder, and routes error output to stderr. |
| scripts/hooks/mixed-line-ending.py | Makes the fixer fail closed and returns None on read errors for proper exit codes. |
| scripts/hooks/markdownlint.py | Sends “tool missing / skipping” messages to stderr. |
| scripts/hooks/end-of-file-fixer.py | Makes the fixer fail closed and returns None on read errors for proper exit codes. |
| scripts/hooks/check-yaml.py | Prints YAML/read errors in {path}:{line} format to stderr; improves “PyYAML missing” messaging. |
| scripts/hooks/check-track-caller-async.py | New hook to detect #[track_caller] applied to async fns (same-line + lookahead detection). |
| scripts/hooks/check-toml.py | Separates decode vs parse vs OS errors; prints formatted stderr with line extraction when available. |
| scripts/hooks/check-merge-conflict.py | Fails closed on unreadable files; prints formatted stderr output. |
| scripts/hooks/check-llm-line-limit.py | Prints failures to stderr in {path}:{line} format and fails closed on read/decode errors. |
| scripts/hooks/check-json.py | Prints JSON/read errors in {path}:{line} format to stderr and removes unused import. |
| scripts/hooks/check-hook-output-format.py | New hook to statically validate other hook scripts’ output-format and fail-closed patterns. |
| scripts/hooks/check-empty-tests.py | Fails closed on unreadable files (returns :0: issue) and prints errors to stderr without indentation. |
| scripts/hooks/check-dockerfile.py | Fails closed on read/decode errors (returns :0: issue) and prints issues to stderr without indentation. |
| scripts/check-links.py | Makes anchor validation fail closed when target/source cannot be read (previously treated as valid). |
| scripts/check-kani-coverage.py | Aligns read errors/tool-missing messages with {path}:0: formatting to stderr. |
| CLAUDE.md | Updates recommended pre-commit command to include --features tokio,json. |
| .pre-commit-config.yaml | Adds check-track-caller-async and check-hook-output-format hooks. |
| .llm/skills/scripting.md | Documents lint-hook stderr formatting, fail-closed patterns, and fixer return conventions. |
| .llm/skills/rust-pitfalls.md | Adds guidance about #[track_caller] on async fns and the new hook. |
| .llm/skills/refactoring.md | Updates clippy commands to include --features tokio,json. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction commands to include --features tokio,json. |
| .llm/skills/async-rust.md | Notes #[track_caller] on async fn as a pitfall. |
| .llm/context.md | Updates canonical quick commands/linting checklist for clippy with tokio,json features. |
| .github/workflows/ci-safety.yml | Runs clippy with --features tokio,json in safety workflow steps. |
| .github/workflows/ci-rust.yml | Runs clippy with --features tokio,json in Rust CI workflow. |
| .github/workflows/ci-docs.yml | Broadens script path triggers and runs all scripts/tests/ with needed deps. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates checklist clippy command to include --features tokio,json. |
| .devcontainer/welcome.sh | Updates displayed clippy command to include --features tokio,json. |
| .cursorrules | Updates quick command to include --features tokio,json. |
| .cargo/config.toml | Updates cargo c alias to run clippy with --features tokio,json. |
Comments suppressed due to low confidence (1)
scripts/hooks/trailing-whitespace.py:16
Path.read_text()performs universal newline translation, so the subsequent logic attempting to detect/preserve\r\nand\rline endings will never trigger (andwrite_text()may re-emit platform-default newlines). If preserving original line endings is intended, read bytes (or open withnewline='') and handle decoding/newlines explicitly; otherwise, consider removing the dead CRLF/CR handling to avoid misleading behavior.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR hardens the repo’s pre-commit/CI “mutation testing” surface by making lint/fixer hooks fail-closed and emit consistent {path}:{line}: {message} output, and by adding comprehensive pytest coverage for those scripts.
Changes:
- Standardize hook error output to stderr with
:0:for file-level errors; fail-closed on unreadable/binary files. - Add new pre-commit hook to detect
#[track_caller]onasync fn, and adjust Rust test code accordingly. - Update clippy invocation/docs/CI to include
--features tokio,jsonso feature-gated code is linted.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] usage on an async helper (documented as intentional). |
| scripts/tests/test_trailing_whitespace.py | Adds unit tests for trailing-whitespace fixer behavior + error handling/output conventions. |
| scripts/tests/test_regenerate_skills_index.py | Adds unit tests for skills index generation, metadata extraction, and fail-closed behavior. |
| scripts/tests/test_mixed_line_ending.py | Adds unit tests for mixed-line-ending fixer behavior + error handling/output conventions. |
| scripts/tests/test_end_of_file_fixer.py | Adds unit tests for end-of-file fixer behavior + error handling/output conventions. |
| scripts/tests/test_check_yaml.py | Adds unit tests for YAML validation including output-format checks. |
| scripts/tests/test_check_track_caller_async.py | Adds unit tests for the new #[track_caller]-on-async-fn checker. |
| scripts/tests/test_check_toml.py | Adds unit tests for TOML validation including line-number/output-format expectations. |
| scripts/tests/test_check_merge_conflict.py | Adds unit tests for merge-conflict marker detection + output-format checks. |
| scripts/tests/test_check_json.py | Adds unit tests for JSON/JSONC validation + output-format checks. |
| scripts/tests/test_check_hook_output_format.py | Adds unit tests for the new meta-hook that enforces hook output conventions. |
| scripts/tests/test_check_empty_tests.py | Adds unit tests ensuring empty Python tests are detected and errors are formatted correctly. |
| scripts/tests/test_check_dockerfile.py | Expands tests to require fail-closed read errors and validate output formatting. |
| scripts/tests/test_check_llm_line_limit.py | Updates tests for stderr-based {path}:{line} output and adds output-format/relative-path assertions. |
| scripts/tests/test_check_links.py | Adds tests ensuring anchor validation fails closed on unreadable/binary targets. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json to lint feature-gated modules. |
| scripts/hooks/trailing-whitespace.py | Switches fixer to `bool |
| scripts/hooks/regenerate-skills-index.py | Makes metadata extraction fail-closed, uses relative paths in error output, and returns (content, had_error). |
| scripts/hooks/mixed-line-ending.py | Switches fixer to `bool |
| scripts/hooks/markdownlint.py | Sends “tool missing / skipping” messaging to stderr (CI/logging consistency). |
| scripts/hooks/end-of-file-fixer.py | Switches fixer to `bool |
| scripts/hooks/check-yaml.py | Prints parse/read errors to stderr in {path}:{line} format; skips gracefully when PyYAML missing. |
| scripts/hooks/check-track-caller-async.py | New hook to detect #[track_caller] applied to async fns. |
| scripts/hooks/check-toml.py | Separates decode vs parse errors; prints to stderr in {path}:{line} format. |
| scripts/hooks/check-merge-conflict.py | Prints conflicts/read errors to stderr in {path}:{line} format; fails closed on read errors. |
| scripts/hooks/check-llm-line-limit.py | Uses relative display_path, prints to stderr in {path}:{line} format, and fails closed on read/decode errors. |
| scripts/hooks/check-json.py | Removes unused import and prints parse/read errors to stderr in {path}:{line} format. |
| scripts/hooks/check-hook-output-format.py | New hook that enforces repository hook-output conventions and fail-closed patterns. |
| scripts/hooks/check-empty-tests.py | Fails closed on unreadable files and prints issues to stderr without leading indentation. |
| scripts/hooks/check-dockerfile.py | Fails closed on unreadable/binary files and ensures paths are relative when repo_root is provided. |
| scripts/hooks/actionlint.py | Uses relative workflow paths when scanning all workflows to keep actionlint output parseable. |
| scripts/check-links.py | Makes anchor validation fail closed when target content can’t be read (instead of silently passing). |
| scripts/check-kani-coverage.py | Updates some diagnostics to {path}:0: style output for read errors. |
| CLAUDE.md | Updates documented clippy command to include --features tokio,json. |
| .pre-commit-config.yaml | Adds check-track-caller-async and check-hook-output-format hooks. |
| .llm/skills/scripting.md | Documents error/output conventions and fail-closed patterns for hooks. |
| .llm/skills/rust-pitfalls.md | Documents #[track_caller] on async fn as a pitfall. |
| .llm/skills/refactoring.md | Updates clippy commands to include feature flags. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction commands to include feature flags. |
| .llm/skills/async-rust.md | Adds note about #[track_caller] not being supported on async fns. |
| .llm/context.md | Updates canonical linting commands to include --features tokio,json. |
| .github/workflows/ci-safety.yml | Ensures clippy runs with --features tokio,json in safety workflow. |
| .github/workflows/ci-rust.yml | Ensures clippy runs with --features tokio,json in Rust CI. |
| .github/workflows/ci-docs.yml | Broadens script-related triggers and runs all scripts/tests/ pytest suite in CI. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates checklist clippy command to include feature flags. |
| .devcontainer/welcome.sh | Updates displayed clippy command to include feature flags. |
| .cursorrules | Updates quick commands to include feature flags. |
| .cargo/config.toml | Updates cargo c alias to run clippy with --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Fortress Rollback Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 2a1e38f | Previous: 1144cca | Ratio |
|---|---|---|---|
Frame arithmetic/add/1 |
1 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
Frame arithmetic/add/10 |
1 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
Frame arithmetic/add/100 |
1 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
Frame arithmetic/add/1000 |
1 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Pull request overview
This PR hardens the repo’s pre-commit/CI scripting ecosystem by making hook behavior more fail-closed and output-format compliant, and by adding a broad set of unit tests to prevent regressions (supporting the “Fix mutation testing” goal).
Changes:
- Added extensive pytest coverage for multiple pre-commit hook scripts (whitespace/EOF/line-ending fixers, YAML/TOML/JSON validators, merge-conflict checks, hook-output-format enforcement, and track_caller-on-async detection).
- Updated several hooks to (a) print diagnostics to stderr in
{path}:{line}: ...format, (b) use:0:for file-level errors, (c) fail closed on unreadable files, and (d) prefer relative display paths. - Updated clippy invocation/documentation/CI to lint feature-gated code via
--features tokio,json, and expanded docs CI to run the fullscripts/tests/suite.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] from an async helper and documents rationale. |
| scripts/hooks/trailing-whitespace.py | Fail-closed behavior + stderr diagnostics + relative path display helper. |
| scripts/hooks/mixed-line-ending.py | Fail-closed behavior + stderr diagnostics + relative path display helper. |
| scripts/hooks/end-of-file-fixer.py | Fail-closed behavior + stderr diagnostics + relative path display helper. |
| scripts/hooks/check-yaml.py | Standardizes stderr diagnostics and adds line-number reporting. |
| scripts/hooks/check-toml.py | Standardizes stderr diagnostics, read-error handling, and line-number reporting. |
| scripts/hooks/check-json.py | Standardizes stderr diagnostics, read-error handling, and display paths. |
| scripts/hooks/check-merge-conflict.py | Changes to fail-closed on unreadable files + formatted stderr output. |
| scripts/hooks/check-empty-tests.py | Standardizes stderr output + fail-closed read errors + relative display paths. |
| scripts/hooks/check-dockerfile.py | Fail-closed read errors, relative paths, and stderr-only reporting. |
| scripts/hooks/markdownlint.py | Routes “tool missing” messages to stderr. |
| scripts/hooks/actionlint.py | Uses relative workflow paths when enumerating to preserve {path}:{line} parsing. |
| scripts/hooks/regenerate-skills-index.py | Fail-closed metadata/index reads, relative paths, and check-only stderr output. |
| scripts/hooks/check-track-caller-async.py | New hook to detect #[track_caller] applied to async fn. |
| scripts/hooks/check-hook-output-format.py | New hook enforcing output/behavior conventions for check-*.py hooks. |
| scripts/hooks/check-llm-line-limit.py | Converts output to {path}:{line} stderr diagnostics and fail-closed reads. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json to lint feature-gated code. |
| scripts/check-links.py | Makes anchor validation fail-closed and uses _rel() for relative-path messaging. |
| scripts/check-kani-coverage.py | Adjusts diagnostics to {path}:0:-style messages for file read/missing cases. |
| scripts/tests/test_trailing_whitespace.py | Adds unit tests for trailing-whitespace fixer behavior and output conventions. |
| scripts/tests/test_mixed_line_ending.py | Adds unit tests for line-ending fixer behavior and output conventions. |
| scripts/tests/test_end_of_file_fixer.py | Adds unit tests for EOF fixer behavior and output conventions. |
| scripts/tests/test_check_yaml.py | Adds unit tests for YAML hook validation and output format. |
| scripts/tests/test_check_toml.py | Adds unit tests for TOML hook validation and output format. |
| scripts/tests/test_check_json.py | Adds unit tests for JSON/JSONC hook validation and output format. |
| scripts/tests/test_check_merge_conflict.py | Adds unit tests for merge-conflict hook detection and output format. |
| scripts/tests/test_check_empty_tests.py | Adds unit tests for empty-test detection + output formatting. |
| scripts/tests/test_check_dockerfile.py | Adds tests ensuring Dockerfile hook fails closed and avoids duplicate output. |
| scripts/tests/test_check_llm_line_limit.py | Updates/extends tests for stderr + relative-path + :0: formatting. |
| scripts/tests/test_check_links.py | Adds tests for fail-closed anchor validation and _rel() behavior. |
| scripts/tests/test_regenerate_skills_index.py | Adds tests for fail-closed metadata reading and main() exit behavior. |
| scripts/tests/test_check_track_caller_async.py | Adds comprehensive tests for the new track_caller-on-async hook. |
| scripts/tests/test_check_hook_output_format.py | Adds comprehensive tests for the new hook-output-format enforcement hook. |
| .pre-commit-config.yaml | Registers new hooks and integrates hook-quality enforcement. |
| .github/workflows/ci-docs.yml | Runs all scripts/tests/ in docs CI and broadens path triggers to scripts/**. |
| .github/workflows/ci-rust.yml | Updates clippy step to include --features tokio,json. |
| .github/workflows/ci-safety.yml | Updates clippy invocations and messaging to include --features tokio,json. |
| .cargo/config.toml | Updates cargo c alias to include --features tokio,json. |
| .llm/context.md | Updates canonical quick commands to include --features tokio,json. |
| .llm/skills/scripting.md | Documents output-format rules, fail-closed patterns, and path-handling guidance. |
| .llm/skills/rust-pitfalls.md | Documents the #[track_caller] on async pitfall and mentions the new hook. |
| .llm/skills/async-rust.md | Adds the #[track_caller] on async pitfall entry. |
| .llm/skills/refactoring.md | Updates refactoring checklist commands for clippy feature flags. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction commands to include feature flags. |
| CLAUDE.md | Updates pre-commit command guidance to include --features tokio,json. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates checklist command to include --features tokio,json. |
| .devcontainer/welcome.sh | Updates displayed clippy command to include --features tokio,json. |
| .cursorrules | Updates quick command snippet to include --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR tightens the repo’s pre-commit/CI scripting ecosystem to be more mutation-testable and policy-compliant by making hooks fail-closed, sending diagnostics to stderr, adding broad unit-test coverage for hook behaviors, and aligning clippy invocations with feature-gated code.
Changes:
- Add/extend unit tests for pre-commit hook scripts (formatting, fail-closed behavior, relative paths, and output conventions).
- Introduce/enable new pre-commit checks (
check-track-caller-async,check-hook-output-format) and standardize script diagnostics (stderr +{path}:{line}:-style where applicable). - Update clippy and documentation/CI to include
--features tokio,jsonso feature-gated code is linted consistently.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] from an async fn test helper and documents why. |
| scripts/validate-wiki-output.py | Routes error reporting to stderr for CI-friendly diagnostics. |
| scripts/tests/test_trailing_whitespace.py | Adds tests for trailing whitespace fixer (incl. fail-closed + output behavior). |
| scripts/tests/test_regenerate_skills_index.py | Adds tests for skills index regeneration (metadata extraction + fail-closed). |
| scripts/tests/test_mixed_line_ending.py | Adds tests for mixed line ending fixer (incl. fail-closed). |
| scripts/tests/test_end_of_file_fixer.py | Adds tests for EOF newline fixer (incl. fail-closed). |
| scripts/tests/test_check_yaml.py | Adds YAML hook tests, including output format expectations. |
| scripts/tests/test_check_track_caller_async.py | Adds comprehensive tests for the new track-caller async detector hook. |
| scripts/tests/test_check_toml.py | Adds TOML hook tests, including decode/read error handling. |
| scripts/tests/test_check_merge_conflict.py | Adds merge-conflict hook tests, including output formatting expectations. |
| scripts/tests/test_check_llm_line_limit.py | Updates tests to expect stderr + relative {path}:{line}-style output. |
| scripts/tests/test_check_links.py | Adds tests for fail-closed anchor validation and stderr-only errors. |
| scripts/tests/test_check_json.py | Adds JSON/JSONC hook tests, including :0: read error behavior. |
| scripts/tests/test_check_hook_output_format.py | Adds tests for the new hook-format enforcement script. |
| scripts/tests/test_check_empty_tests.py | Adds tests ensuring empty-test detection + output conventions. |
| scripts/tests/test_check_dockerfile.py | Updates dockerfile hook tests to enforce fail-closed + no-duplicate output. |
| scripts/run-cargo-fmt.py | Sends warnings/errors to stderr for consistency with hook conventions. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json and sends errors to stderr. |
| scripts/hooks/trailing-whitespace.py | Makes fixer fail-closed (returns None on error) and improves path display. |
| scripts/hooks/regenerate-skills-index.py | Makes index generation fail-closed and improves error reporting and paths. |
| scripts/hooks/mixed-line-ending.py | Makes fixer fail-closed and improves path display + stderr diagnostics. |
| scripts/hooks/markdownlint.py | Sends “tool missing” messages to stderr. |
| scripts/hooks/end-of-file-fixer.py | Makes fixer fail-closed and improves path display + stderr diagnostics. |
| scripts/hooks/check-yaml.py | Adds relative path output, stderr diagnostics, and proper line numbers. |
| scripts/hooks/check-track-caller-async.py | New hook to detect #[track_caller] on async fn in Rust. |
| scripts/hooks/check-toml.py | Adds relative path output, stderr diagnostics, and separates decode vs parse errors. |
| scripts/hooks/check-merge-conflict.py | Makes unreadable files fail the hook and reports errors to stderr. |
| scripts/hooks/check-llm-line-limit.py | Uses relative paths and stderr output with :0: for file-level failures. |
| scripts/hooks/check-json.py | Adds relative path output + stderr diagnostics; improves read error handling. |
| scripts/hooks/check-hook-output-format.py | New meta-hook enforcing output conventions for hook scripts. |
| scripts/hooks/check-empty-tests.py | Improves error output (stderr + relative paths) and avoids indented issue lines. |
| scripts/hooks/check-dockerfile.py | Makes unreadable files fail-closed and outputs only via returned issues + stderr in main. |
| scripts/hooks/actionlint.py | Uses relative workflow paths to preserve {path}:{line} parsing from actionlint. |
| scripts/check-wiki-consistency.py | Routes errors/warnings to stderr for CI-friendly diagnostics. |
| scripts/check-rustdoc-links.py | Routes rustdoc failure output to stderr consistently. |
| scripts/check-links.py | Makes anchor validation fail-closed and routes errors to stderr. |
| scripts/check-kani-coverage.py | Standardizes read/validation diagnostics to stderr and relative paths where applicable. |
| CLAUDE.md | Updates recommended clippy invocation to include --features tokio,json. |
| .pre-commit-config.yaml | Adds check-track-caller-async and check-hook-output-format hooks. |
| .llm/skills/scripting.md | Documents lint-script output, path, and fail-closed conventions more explicitly. |
| .llm/skills/rust-pitfalls.md | Documents #[track_caller] + async pitfall and references the new hook. |
| .llm/skills/refactoring.md | Updates clippy command examples to include --features tokio,json. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction commands to include --features tokio,json. |
| .llm/skills/async-rust.md | Adds #[track_caller] on async fn pitfall note. |
| .llm/context.md | Updates canonical quick commands and linting checklist to include feature flags. |
| .github/workflows/ci-safety.yml | Ensures clippy in safety workflow runs with --features tokio,json. |
| .github/workflows/ci-rust.yml | Ensures clippy in Rust CI runs with --features tokio,json. |
| .github/workflows/ci-docs.yml | Expands script-change triggers and runs the full scripts/tests/ suite. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates contributor checklist clippy command to include feature flags. |
| .devcontainer/welcome.sh | Updates developer guidance for clippy to include feature flags. |
| .cursorrules | Updates quick commands for clippy to include feature flags. |
| .cargo/config.toml | Updates cargo c alias to include --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR tightens CI/pre-commit behavior around mutation testing by making repository hook scripts more “fail-closed”, standardizing diagnostics (stderr + {path}:{line}: ...), and extending automated test coverage for these hooks.
Changes:
- Standardize hook/script diagnostics to stderr and enforce consistent
{path}:{line}: ...formatting (plus:0:for file-level errors). - Add/enable new pre-commit hooks (
check-track-caller-async,check-hook-output-format) and broaden CI docs workflow to run allscripts/tests/. - Add extensive pytest coverage for multiple hook scripts and adjust some hook semantics to fail on unreadable/binary inputs.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/network/tokio_socket.rs |
Removes #[track_caller] from an async fn test helper and documents why. |
scripts/validate-wiki-output.py |
Moves errors/warnings to stderr and reformats issue output lines. |
scripts/tests/test_trailing_whitespace.py |
Adds unit tests for trailing-whitespace fixer behavior and error handling. |
scripts/tests/test_regenerate_skills_index.py |
Adds unit tests for skills index regeneration (metadata parsing + fail-closed). |
scripts/tests/test_mixed_line_ending.py |
Adds unit tests for mixed line ending fixer behavior and error handling. |
scripts/tests/test_end_of_file_fixer.py |
Adds unit tests for end-of-file fixer behavior and error handling. |
scripts/tests/test_check_yaml.py |
Adds unit tests for YAML validation and output format. |
scripts/tests/test_check_track_caller_async.py |
Adds unit tests for detecting #[track_caller] on async fn (same-line + lookahead). |
scripts/tests/test_check_toml.py |
Adds unit tests for TOML validation, line numbers, and read/encoding errors. |
scripts/tests/test_check_merge_conflict.py |
Adds unit tests for merge conflict marker detection and output formatting. |
scripts/tests/test_check_llm_line_limit.py |
Updates tests for stderr + {path}:{line} output and adds Unicode decode coverage. |
scripts/tests/test_check_links.py |
Adds tests to ensure anchor validation fails closed and errors go to stderr. |
scripts/tests/test_check_json.py |
Adds unit tests for JSON/JSONC validation and output format. |
scripts/tests/test_check_hook_output_format.py |
Adds extensive tests for the new hook output format checker. |
scripts/tests/test_check_empty_tests.py |
Adds unit tests for empty test detection and output conventions. |
scripts/tests/test_check_dockerfile.py |
Adds tests for fail-closed file handling and output formatting (no duplicates). |
scripts/run-cargo-fmt.py |
Sends warning/error diagnostics to stderr. |
scripts/run-cargo-clippy.py |
Runs clippy with --features tokio,json and moves diagnostics to stderr. |
scripts/hooks/trailing-whitespace.py |
Adds _display_path, fail-closed semantics, and stderr read-error reporting. |
scripts/hooks/regenerate-skills-index.py |
Makes metadata extraction/build fail-closed; emits structured read/write errors. |
scripts/hooks/mixed-line-ending.py |
Adds _display_path, fail-closed semantics, and stderr read-error reporting. |
scripts/hooks/markdownlint.py |
Prints “tool missing” diagnostics to stderr. |
scripts/hooks/end-of-file-fixer.py |
Adds _display_path, fail-closed semantics, and stderr read-error reporting. |
scripts/hooks/check-yaml.py |
Adds _display_path, stderr diagnostics, and better line reporting for YAML errors. |
scripts/hooks/check-track-caller-async.py |
New hook to detect #[track_caller] applied to async functions. |
scripts/hooks/check-toml.py |
Adds _display_path, stderr diagnostics, and separates read vs parse errors. |
scripts/hooks/check-merge-conflict.py |
Switches to fail-closed on read errors and uses stderr {path}:{line} output. |
scripts/hooks/check-llm-line-limit.py |
Uses relative paths + stderr and :0: for line-limit/read errors. |
scripts/hooks/check-json.py |
Adds _display_path, stderr diagnostics, and handles read/encoding errors. |
scripts/hooks/check-hook-output-format.py |
New hook to enforce output conventions and fail-closed patterns in hook scripts. |
scripts/hooks/check-empty-tests.py |
Adds _display_path, stderr output, and fail-closed read error behavior. |
scripts/hooks/check-dockerfile.py |
Uses relative paths, fail-closed read errors, and stderr summary output. |
scripts/hooks/actionlint.py |
Uses relative paths for actionlint invocation; prints “tool missing” to stderr. |
scripts/check-wiki-consistency.py |
Routes error/warning diagnostics to stderr. |
scripts/check-rustdoc-links.py |
Routes cargo doc failure diagnostics to stderr. |
scripts/check-links.py |
Makes anchor validation fail-closed and sends ERROR output to stderr. |
scripts/check-kani-coverage.py |
Standardizes read-error output to {path}:0: and moves diagnostics to stderr. |
CLAUDE.md |
Updates clippy command guidance to include --features tokio,json. |
.pre-commit-config.yaml |
Adds new hooks (check-track-caller-async, check-hook-output-format). |
.llm/skills/scripting.md |
Documents lint-script output rules (stderr + {path}:{line} + fail-closed). |
.llm/skills/rust-pitfalls.md |
Documents #[track_caller] on async as a pitfall and notes the new hook. |
.llm/skills/refactoring.md |
Updates clippy guidance to include --features tokio,json. |
.llm/skills/ci-debugging.md |
Updates clippy debugging commands to include --features tokio,json. |
.llm/skills/async-rust.md |
Adds #[track_caller] on async to the async pitfalls table. |
.llm/context.md |
Updates canonical clippy guidance to include --features tokio,json. |
.github/workflows/ci-safety.yml |
Runs clippy with --features tokio,json in safety jobs. |
.github/workflows/ci-rust.yml |
Runs clippy with --features tokio,json. |
.github/workflows/ci-docs.yml |
Expands triggers to all scripts/** and runs all script tests. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates checklist clippy command to include --features tokio,json. |
.devcontainer/welcome.sh |
Updates clippy guidance to include --features tokio,json. |
.cursorrules |
Updates quick command to include --features tokio,json. |
.cargo/config.toml |
Updates cargo c alias to include --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR tightens and standardizes pre-commit/CI behavior around “mutation testing” of repo scripts and Rust linting, with an emphasis on fail-closed behavior and consistent {path}:{line}: diagnostics.
Changes:
- Add/extend pre-commit hooks to catch
#[track_caller]onasync fnand to enforce hook output formatting conventions. - Normalize many scripts/hooks to emit errors on
stderr, include line numbers (using:0:for file-level errors), and avoid absolute paths where possible. - Expand CI docs workflow to run the full
scripts/tests/suite and install needed Python deps; update clippy invocations to include--features tokio,json.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/network/tokio_socket.rs | Removes #[track_caller] from an async fn test helper and documents why. |
| scripts/validate-wiki-output.py | Wraps stderr for UTF-8 and moves error output to stderr. |
| scripts/tests/test_trailing_whitespace.py | Adds unit coverage for trailing-whitespace fixer behavior and output conventions. |
| scripts/tests/test_regenerate_skills_index.py | Adds unit coverage for skill index generation incl. fail-closed read errors. |
| scripts/tests/test_mixed_line_ending.py | Adds unit coverage for mixed line ending fixer behavior and output conventions. |
| scripts/tests/test_end_of_file_fixer.py | Adds unit coverage for EOF fixer behavior and output conventions. |
| scripts/tests/test_check_yaml.py | Adds unit coverage for YAML validation and {path}:{line}: stderr output. |
| scripts/tests/test_check_track_caller_async.py | Adds unit coverage for #[track_caller]-on-async detection scenarios and output format. |
| scripts/tests/test_check_toml.py | Adds unit coverage for TOML validation and {path}:{line}: stderr output. |
| scripts/tests/test_check_merge_conflict.py | Adds unit coverage for merge conflict marker detection and output format. |
| scripts/tests/test_check_llm_line_limit.py | Updates tests for stderr + {path}:{line}: output and adds format tests. |
| scripts/tests/test_check_links.py | Adds tests ensuring anchor validation fails closed on unreadable/binary targets and stderr routing. |
| scripts/tests/test_check_json.py | Adds unit coverage for JSON/JSONC validation and {path}:{line}: stderr output. |
| scripts/tests/test_check_hook_output_format.py | Adds a large test suite for the new hook output format checker. |
| scripts/tests/test_check_empty_tests.py | Adds unit coverage for empty-test detection and output format. |
| scripts/tests/test_check_dockerfile.py | Extends dockerfile hook tests for fail-closed read errors and output formatting. |
| scripts/run-cargo-fmt.py | Routes warning/error prints to stderr. |
| scripts/run-cargo-clippy.py | Runs clippy with --features tokio,json and routes errors to stderr. |
| scripts/hooks/trailing-whitespace.py | Adds relative-path display, fail-closed error reporting, and distinct error return. |
| scripts/hooks/mixed-line-ending.py | Adds relative-path display, fail-closed error reporting, and distinct error return. |
| scripts/hooks/markdownlint.py | Moves “tool missing” messages to stderr. |
| scripts/hooks/end-of-file-fixer.py | Adds relative-path display, fail-closed error reporting, and distinct error return. |
| scripts/hooks/check-yaml.py | Adds relative-path display, stderr diagnostics, and accurate YAML line reporting. |
| scripts/hooks/check-track-caller-async.py | Introduces new hook to detect #[track_caller] on async fn. |
| scripts/hooks/check-toml.py | Adds relative-path display and stderr diagnostics with best-effort line reporting. |
| scripts/hooks/check-merge-conflict.py | Switches to fail-closed on unreadable files and standardizes stderr diagnostics. |
| scripts/hooks/check-llm-line-limit.py | Standardizes stderr {path}:{line}: output and relative path handling. |
| scripts/hooks/check-json.py | Standardizes stderr {path}:{line}: output and read error handling. |
| scripts/hooks/check-hook-output-format.py | Adds new hook enforcing lint-script output conventions (leading whitespace, line numbers, stderr, fail-closed patterns, etc.). |
| scripts/hooks/check-empty-tests.py | Standardizes stderr output and relative path formatting. |
| scripts/hooks/check-dockerfile.py | Makes read errors fail closed and standardizes relative {path}:{line}: issues. |
| scripts/hooks/actionlint.py | Ensures actionlint is invoked with relative workflow paths for proper {path}:{line}: parsing. |
| scripts/check-wiki-consistency.py | Wraps stderr for UTF-8 and routes errors/warnings to stderr. |
| scripts/check-rustdoc-links.py | Routes cargo doc failure details to stderr. |
| scripts/check-links.py | Makes anchor validation fail closed on unreadable/binary targets and routes errors to stderr. |
| scripts/check-kani-coverage.py | Standardizes read-error diagnostics to {path}:{line}: on stderr and routes warnings/errors to stderr. |
| CLAUDE.md | Updates documented clippy invocation to include --features tokio,json. |
| .pre-commit-config.yaml | Adds check-track-caller-async and check-hook-output-format hooks. |
| .llm/skills/scripting.md | Documents enforced lint script output/path/error-handling rules and the hook checks. |
| .llm/skills/rust-pitfalls.md | Adds explicit async pitfall for #[track_caller] on async fn. |
| .llm/skills/refactoring.md | Updates clippy commands to include --features tokio,json. |
| .llm/skills/ci-debugging.md | Updates clippy reproduction commands to include --features tokio,json. |
| .llm/skills/async-rust.md | Adds pitfall row for #[track_caller] on async fn. |
| .llm/context.md | Updates canonical pre-commit/clippy commands to include --features tokio,json. |
| .github/workflows/ci-safety.yml | Ensures safety clippy runs include --features tokio,json. |
| .github/workflows/ci-rust.yml | Ensures clippy runs include --features tokio,json. |
| .github/workflows/ci-docs.yml | Broadens script triggers and runs all script tests with needed deps. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates checklist clippy command to include --features tokio,json. |
| .devcontainer/welcome.sh | Updates suggested clippy command to include --features tokio,json. |
| .cursorrules | Updates quick command to include --features tokio,json. |
| .cargo/config.toml | Updates cargo c alias to include --features tokio,json. |
You can also share your feedback on Copilot code review. Take the survey.
Description
Type of Change
Checklist
Required
unwrap()in production codeexpect()in production codepanic!()ortodo!()Resultcargo fmt && cargo clippy --all-targetswith no warningscargo nextest runand all tests passIf Applicable
CHANGELOG.mdfor user-facing changesexamples/directoryTesting
Tests added/modified:
Manual testing performed:
Related Issues