Repository navigation
Deeper Go and Rust checks: interface{}/any and unsafe density, cargo workspaces - #13
Merged
Merged
Conversation
…workspaces
- types.go-any: interface{}/any as a type per kloc of Go product code
(generic constraints, comments, strings, tests, generated files excluded)
- types.rust-unsafe: unsafe blocks/fns/impls per kloc of Rust (-sys crates
skipped; forbid(unsafe_code) scores 1)
- feedback.cargo-workspace: one cargo workspace reaches every crate;
flags nested workspaces and orphan crates, understands members globs,
exclude, path dependencies and fuzz/ crates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: src/checks/index.ts (goRustChecks registered with docHistoryCheck, agentToolingChecks and runChecks), README.md (check table merged: Rust cargo-workspace item kept; also lists the MCP/hooks, Go any / Rust unsafe density and agent-permissions checks; roadmap keeps all ticks and the '(Go/Rust done)' note), CHANGELOG.md (one [Unreleased]). feedback.cargo-workspace is repo-only in per-package scans, like feedback.ci. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Roadmap item (part 1 of 2): Deeper Go and Rust checks: unsafe and
interface{}density, and nestedCargo.tomlworkspaces. Java/Kotlin comes in a separate PR.What
Three new checks in
src/checks/go-rust.ts. Each is n/a when the language is absent and weighted by the language's share of the code (weightScale).types.go-anyinterface{}andanyused as a type per kloc of Go product code. Not counted: generic constraints ([T any],[K comparable, V any],[K, V any]), comments and strings,_test.go,.pb.go/_gen.go/zz_generated, vendor and examples.infofindingstypes.rust-unsafeunsafe { },unsafe fn/impl/trait/externper kloc of Rust product code. Comments and strings stripped;-sysFFI crates, tests, benches and fuzz skipped.#![forbid(unsafe_code)]/#![deny(unsafe_code)]in every crate root, orunsafe_code = "forbid"in Cargo.toml, scores 1.feedback.cargo-workspacecodex-rs/). Understood:membersglobs,exclude(deliberate, not counted), path dependencies, which Cargo makes implicit members, and cargo-fuzzfuzz/workspaces (skipped). Flagged: separate nested workspaces and crates in no workspace.The penalties are deliberately mild (floor 0.7), in line with how
types.typescripttreatsany. Runtimes and FFI code legitimately needunsafe, and Go APIs like zap's sugared logger takeinterface{}by design.Tests
test/go-rust.test.ts(8 tests) covers:.pb.goexcluded-sysskipping andforbid(unsafe_code)npm run check && npm run buildpass (91 tests). Self-score is still 100/100.Scores (before → after)
tools/argument-comment-lintis a separate workspace and is flagged.An earlier draft flagged 3 codex crates as "in no workspace". They were path dependencies, which Cargo adds as members automatically, so this is now handled.
🤖 Generated with Claude Code