Repository navigation
refactor: apply the template's numeric lint rules - #166
Merged
Merged
Conversation
3 tasks done
Contributor
Author
追加の対応
|
furedea
added a commit
that referenced
this pull request
Oct 21, 2026
…ies (#167) ## 概要 main の CI(rust-audit / cargo-deny)が次の 2 件の advisory で失敗しているため,ureq 経由で入っている 2 つの crate を修正版に更新します.変更は `Cargo.lock` だけです. | advisory | crate | 更新前 | 更新後 | | --- | --- | --- | --- | | RUSTSEC-2026-0382 | rustls-webpki | 0.103.15 | 0.103.16 | | RUSTSEC-2026-0381 | webpki-roots | 1.0.9 | 1.0.10 | ## 確認項目 - [x] `cargo update -p rustls-webpki -p webpki-roots` 以外の依存は変わっていない - [x] `cargo deny check`: advisories ok, bans ok, licenses ok, sources ok - [x] `cargo test`: 全件 pass ## 詳細 flake は `cargoLock.lockFile = ./Cargo.lock` を参照しており,固定ハッシュは持っていないため,flake 側の更新は不要です. #166(numeric lint の適用)は,このPRのマージ後に rebase します. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Enable clippy all/pedantic with the nesting, argument-count, and cognitive complexity thresholds from template-rust, and add the lefthook file-length check. Refs furedea/dotfiles#247 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move branchy method bodies into module-level helpers, group the minted token and issuer into MintedToken, and move inline test modules of github_app and source into sibling files. Pin the hooks inventory output with tests before restructuring it. Refs furedea/dotfiles#247 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Group source, external hooks, and runtime root into GenerationContext and skill destinations into SkillTarget so no function takes more than three arguments. Extract nested blocks into helpers, split frontmatter parsing and the hooks and skills tests into submodules to keep files under 500 lines, and pin hook relocation, metadata ordering, and frontmatter parsing with tests before restructuring them. Refs furedea/dotfiles#247 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Split the generated-artifact and external-hook-bundle suites into path submodules to keep each file under 500 lines, and extract nested helpers. Refs furedea/dotfiles#247 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Index the provider hooks key only after the bundle's hook file is known to exist. Indexing first inserted a null hooks key into an empty Devin section, and sync-devin-config then replaced the existing hooks with null. Refs furedea/dotfiles#247 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rust module directories are identifiers, so src/github_app violated the kebab-case directory rule. Scope a snake_case directory rule to src and re-merge the file rules through a YAML anchor, since a nested ls-lint block replaces the root rules. Other directories, including tests/, keep kebab-case. Matches template-rust. Refs furedea/dotfiles#247 Co-Authored-By: Claude Opus 5.5 <[email protected]>
furedea-agent
Bot
force-pushed
the
refactor/apply-numeric-lint
branch
from
October 21, 2026 04:57
5b6a6e0 to
c64eb26
Compare
1 of 2 tasks
furedea
added a commit
to furedea/dotfiles
that referenced
this pull request
Oct 21, 2026
## 概要 - `flake.lock` の `agent-harness` を main の最新(4057e01)に上げる.手元で `switch` 済み. - 中身は furedea/agent-harness#166(数値 lint を入れるための,振る舞いを変えないリファクタリング)と #167(`rustls-webpki` と `webpki-roots` の脆弱性の修正). | 項目 | 変更前 | 変更後 | |---|---|---| | agent-harness | 60c871b(0.9.5) | 4057e01(main) | ## 受け入れ条件 - [x] 手元で `switch` できる - [ ] CI が通る <details> <summary>参照元</summary> - furedea/agent-harness#166,#167 - Refs #247 </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
概要
template-rust と同じ数値系 lint と,lefthook の
file-length(500 行)を導入しました.既存の違反は,挙動を変えないリファクタですべて解消しています.#[allow]/#[expect]は追加していません.導入した clippy の設定は次のとおりです.
too-many-arguments-threshold3excessive-nesting-threshold2cognitive-complexity-threshold15allow_attributes_without_reasonあわせて,Rust のモジュールディレクトリ(snake_case)が ls-lint の
.dirルールに違反していた既存の問題も直しました.Refs furedea/dotfiles#247
違反数
clippy::excessive_nestingclippy::too_many_argumentsclippy::cognitive_complexityneedless_pass_by_value6,format_push_string3 など)cargo clippy --all-targets).dir違反(src/github_app)500 行を超えていたのは次の 6 ファイルです.
skills.rs(804 行)github_app.rs(668 行)hooks.rs(613 行)cli.rs(525 行)tests/neutral_generated_artifacts.rs(868 行)tests/external_hook_bundles.rs(653 行)受け入れ条件
Cargo.toml/clippy.tomlと lefthook(file-length)に入っている詳細
設定
Cargo.toml:[lints.clippy]に,template と同じ次のルールを追加しました.既存のdbg_macroなどの deny は残しています.all/pedanticallow_attributes_without_reasoncognitive_complexityexcessive_nestingclippy.toml: template のファイルをそのまま追加しました.lefthook.yml: template のfile-lengthコマンドを追加しました..ls-lint.yml: template-rust と同じ構造に揃えました.<<: &files)にまとめました.src:ブロックでは<<: *filesでその規則を取り込み,.dir: regex:[a-z0-9]+(_[a-z0-9]+)*を指定しました..dirだけを書くと,src配下のファイル名規則が黙って外れます.tests/を含むsrc以外のディレクトリは,kebab-case のままです.ls-lint の確認(一時ファイル・ディレクトリは確認後に削除済み)
ls_lintsrc/bad-dir.dir)src/good_dirsrc/BadFile.rs.*.src配下でもファイル規則が効いている)tests/bad_dirリファクタ方針
implとmod testsもネストに数えられます.そのため,メソッド本体のif/for/ 複数行クロージャはそれだけで違反になります.if … bail!はensure!に置き換えました.GenerationContext { source, external_hooks, runtime_root }SkillTarget { provider, path }MintedToken { token, issuer }CommandRelocation,CommandNormalization,HookLocationsrc/<module>/tests.rs)に移すskills/frontmatter.rs)#[path = "neutral-generated-artifacts/x.rs"] mod x;の形で分割しました.テスト crate 名とテスト件数は変わっていません.Codex レビューの指摘への対応
ExternalHookBundle::merge_hooksは,bundle の provider ファイルがあるかを確認する前にhooks["hooks"]を可変参照で取っていました."devin": {}の source に Claude 専用の--extra-hookを渡すと,hooks: nullが挿入されていました.sync-devin-configが既存の Devin hooks を null で上書きしていました.HookFile::targetを追加し,bundle のファイルを読めたときだけ参照を取るようにしました.bundle_without_devin_hooks_keeps_existing_devin_hooksを追加しました.修正前のコードで失敗することを確認済みです.挙動固定のために追加したテスト
確認結果(rebase 後の c64eb26)
cargo clippy --all-targets -- -D warningscargo testcargo deny checklefthook run pre-commit --all-filesls_lint(引数なし)🤖 Generated with Claude Code