Repository navigation
build: deny unwrap, expect, indexing, and unsafe code in production - #18
Merged
Merged
Conversation
Copy agent-harness's dbg_macro, todo, and unimplemented deny and unsafe_code = "forbid". Add unwrap_used and expect_used (deny) and let tests use them through clippy.toml. Production code has 0 violations. Refs furedea/agent-config#74 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Review summaryI found no blocking issues and posted no inline comments.
Findings: P0: 0, P1: 0, P2: 0, P3: 0. |
Match agent-harness: deny clippy::indexing_slicing and allow it in tests through clippy.toml. Production code has 0 violations. Refs furedea/agent-config#74 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
assert!(true) checks nothing and fails clippy --all-targets (assertions_on_constants). Move the greeting into a function and test its value. Refs furedea/agent-config#74 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Review summary: no blocking findings.
P0/P1: 0. No inline comments. 🤖 Generated with Claude Code |
furedea
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs furedea/agent-config#74
概要
agent-config#74 段階 1B.template-rust の clippy 設定に,agent-harness と同じ deny 規則を入れ,
unwrap_used,indexing_slicing,expect_usedを追加する.Cargo.toml:[lints.rust] unsafe_code = "forbid",dbg_macro/todo/unimplemented/unwrap_used/indexing_slicing/expect_usedを deny(並びは agent-harness と同じ)clippy.toml:allow-unwrap-in-tests,allow-expect-in-tests,allow-indexing-slicing-in-testsをtruesrc/main.rs: 何も検証しないテストassert!(true)を,挨拶文を返す関数greeting()の値を検証するテストに置き換えた違反数
unwrap_usedindexing_slicingexpect_useddbg_macro/todo/unimplementedunsafe_code違反の修正
追加した規則による違反はなく,
#[expect]や#[allow],その他の抑制も追加していない.assert!(true)をgreeting()のテストへassert!(true)は何も検証せず,cargo clippy --all-targetsがassertions_on_constantsで失敗していた.テストできる単位(挨拶文)を関数にして,値を検証する規則の対応表
clippy::unwrap_usedagents/skills/rust-style/references/errors.md:9Cargo.toml[lints.clippy],clippy.tomlclippy::expect_usedclippy::indexing_slicingagents/skills/rust-style/references/errors.md:15clippy::dbg_macro/todo/unimplementedagents/skills/rust-style/references/errors.md:17Cargo.toml[lints.clippy]rust::unsafe_codeCargo.toml[lints.rust]検証
nix develop内で実行した.cargo clippy --all-targets -- -D warnings: 通過cargo clippy -- -D warnings(CI と同じ): 通過cargo fmt --check: 通過cargo test: 1 件通過規則が効いていることを,一時的に
src/main.rsへunwrap()/expect()/ 添字アクセスを本番とテストに書いて確認した(確認後に元へ戻した).unwrap_used,expect_used,indexing_slicingが発火した.#[cfg(test)]内:この 3 規則は発火しなかった(unnecessary_literal_unwrapとuseless_vecは別の規則).🤖 Generated with Claude Code