Skip to content

Commit 08aee36

Browse files
authored
Modernize Rust workspace (#1903)
* Modernize Rust workspace and simplify checker and renderer * Use Clap for renderer and checker command-line arguments * Group workspace crates and model GitHub repositories as a type * Give contribution criteria a shared Check trait * Use displayable comments and share GitHub repository parsing * Encapsulate renderer GitHub requests in a client type * Use crate version in renderer user agent * Enforce entry name and tag invariants with validated types * Move renderer regression coverage to integration tests * Parse catalog paths into ToolPath and load entries through ToolEntry * Collect tool outcomes into a Reports type * Import filesystem and path names in checker CLI * Return typed ExitCode values from report outcomes
1 parent 5717153 commit 08aee36

37 files changed

Lines changed: 2843 additions & 1478 deletions

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
REPO: ${{ github.repository }}
3939
run: |
4040
gh api "repos/$REPO/issues/$PR/comments" \
41-
-f body="README.md was edited directly. Please edit tool entries in \`data/tools/\`, related collections in \`data/collections/\`, or text and structure in \`ci/render/templates/README.md\` instead. Leave the generated README.md out of your pull request." \
41+
-f body="README.md was edited directly. Please edit tool entries in \`data/tools/\`, related collections in \`data/collections/\`, or text and structure in \`ci/crates/render/templates/README.md\` instead. Leave the generated README.md out of your pull request." \
4242
--silent
4343
echo "README.md must not be edited directly." >&2
4444
exit 1
@@ -56,8 +56,11 @@ jobs:
5656
- name: Install Rust toolchain
5757
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
5858
with:
59-
toolchain: 1.98.0
60-
components: clippy
59+
toolchain: 1.98.1
60+
components: clippy, rustfmt
61+
62+
- name: Check formatting
63+
run: make fmt-check
6164

6265
- name: Run Clippy
6366
run: make clippy

‎.github/workflows/pr-check.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
if: steps.tools.outputs.found == 'true'
7676
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
7777
with:
78-
toolchain: 1.98.0
78+
toolchain: 1.98.1
7979

8080
- name: Build trusted checker
8181
if: steps.tools.outputs.found == 'true'
@@ -114,7 +114,7 @@ jobs:
114114
115115
## [FAIL] Generated README changed
116116
117-
`README.md` is generated and should not be included in tool submissions. Please remove its changes from this PR and submit tool entries under `data/tools/` instead. For changes to the README text or structure, edit `ci/render/templates/README.md` rather than the generated file.
117+
`README.md` is generated and should not be included in tool submissions. Please remove its changes from this PR and submit tool entries under `data/tools/` instead. For changes to the README text or structure, edit `ci/crates/render/templates/README.md` rather than the generated file.
118118
119119
This check will remain failed until the `README.md` changes are removed. README changes alone do not automatically close the PR.
120120
EOF

‎.github/workflows/render.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Rust toolchain
2020
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
2121
with:
22-
toolchain: 1.98.0
22+
toolchain: 1.98.1
2323

2424
- name: Render list
2525
run: make render

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
logcli-linux-amd64
22
logcli.zip
33
ci/target/
4-
ci/pr-check/target/
4+
ci/crates/*/target/

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Your goal is to help the user submit a high-quality pull request that aligns wit
99
When the user asks you to add a new static analysis tool, please act as a helpful code reviewer:
1010
1. **Verify the criteria:** Check the requirements in `CONTRIBUTING.md`: at least 20 GitHub stars, at least six months of history, and more than one human contributor.
1111
2. **Wait until the tool qualifies:** If any criterion is not met, do not submit a pull request yet. Explain that the bot closes PRs with verified criteria failures and encourage the user to submit once all requirements are met. If a criterion cannot be verified automatically, provide evidence for manual review rather than claiming it passed.
12-
3. **Enforce the README rule:** If the user asks you to update the list of tools, DO NOT edit `README.md`. Explain to the user that the list of tools in `README.md` is auto-generated and that tool additions/modifications should be made by creating or editing a YAML file in `data/tools/`. For changes to the README text or structure, edit `ci/render/templates/README.md`. Do not include generated `README.md` changes in a pull request; CI flags them as a failure.
12+
3. **Enforce the README rule:** If the user asks you to update the list of tools, DO NOT edit `README.md`. Explain to the user that the list of tools in `README.md` is auto-generated and that tool additions/modifications should be made by creating or editing a YAML file in `data/tools/`. For changes to the README text or structure, edit `ci/crates/render/templates/README.md`. Do not include generated `README.md` changes in a pull request; CI flags them as a failure.
1313

1414
Thank you for helping us maintain a high-quality list and respecting the maintainers' time!

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,18 @@ provide evidence of that history. Missing registration data also requires review
3737
manually.** Leave generated `README.md` changes out of your pull request, even
3838
if you run `make render` locally. CI will flag them as a failure in the PR
3939
comment. For changes to the README text or structure, edit
40-
`ci/render/templates/README.md` instead.
40+
`ci/crates/render/templates/README.md` instead.
4141

4242
To add a new tool, please create a file in the `data/tools` directory like
4343
`data/tools/<toolname>.yml`. Feel free to check out a few other YAML files in
4444
that directory to see how it should look like.
4545

46+
- Use a nonblank tool name of at most **50 UTF-8 bytes** (non-ASCII characters
47+
can take more than one byte).
4648
- Make each tool description as precise as possible. Please limit the
4749
description to **500 characters**.
4850
- Add a license. If it's a proprietary tool, use `license: proprietary`.
49-
- Please add as many tags as possible. You can choose from the tags in
51+
- Add at least one tag, and include as many relevant tags as possible. Choose from
5052
`data/tags.yml`. If a tool does not match any existing tag, feel free to add a
5153
new tag but also add it to `data/tags.yml`.
5254
- For AI-related tools, add `ai-generated-code` if the tool analyzes

‎Makefile‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
# Static Analysis Tools Repository Makefile
22

3-
.PHONY: render render-skip-deprecated check clippy fmt test clean help
3+
.PHONY: render render-skip-deprecated check clippy fmt fmt-check test clean help
44

55
# Default target shows help
66
help:
77
@echo "Available targets:"
88
@echo " render - Render README.md and JSON API from YAML sources"
9-
@echo " render-skip-deprecated - Render without deprecated tools"
9+
@echo " render-skip-deprecated - Render using cached deprecation data (no GitHub requests)"
1010
@echo " check - Run cargo check"
1111
@echo " clippy - Run clippy lints"
1212
@echo " fmt - Format Rust code"
13+
@echo " fmt-check - Check Rust formatting without changing files"
1314
@echo " test - Run tests"
1415
@echo " clean - Clean build artifacts"
1516
@echo " help - Show this help"
1617

1718
# Main rendering targets
1819
render:
19-
cargo run --manifest-path ci/Cargo.toml -p render -- --tags data/tags.yml --tools data/tools --collections data/collections --md-out README.md --json-out data/api
20+
cargo run --manifest-path ci/Cargo.toml --locked -p render -- --tags data/tags.yml --tools data/tools --collections data/collections --md-out README.md --json-out data/api
2021

2122
render-skip-deprecated:
22-
cargo run --manifest-path ci/Cargo.toml -p render -- --tags data/tags.yml --tools data/tools --collections data/collections --md-out README.md --json-out data/api --skip-deprecated
23+
cargo run --manifest-path ci/Cargo.toml --locked -p render -- --tags data/tags.yml --tools data/tools --collections data/collections --md-out README.md --json-out data/api --skip-deprecated
2324

2425
# Development targets
2526
check:
26-
cargo check --manifest-path ci/Cargo.toml
27+
cargo check --manifest-path ci/Cargo.toml --workspace --all-targets --locked
2728

2829
clippy:
2930
cargo clippy --manifest-path ci/Cargo.toml --workspace --all-targets --all-features --locked -- -D warnings
3031

3132
fmt:
32-
cargo fmt --manifest-path ci/Cargo.toml
33+
cargo fmt --manifest-path ci/Cargo.toml --all
34+
35+
fmt-check:
36+
cargo fmt --manifest-path ci/Cargo.toml --all --check
3337

3438
test:
3539
cargo test --manifest-path ci/Cargo.toml --workspace --all-targets --all-features --locked

0 commit comments

Comments
 (0)