Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2024"
[dependencies]

[lints.clippy]
pedantic = "warn"
pedantic = { level = "warn", priority = -1 }

# 1. hygiene
allow_attributes = "deny"
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ clean: ## Remove build artifacts
$(CARGO) clean

test: ## Run tests with warnings treated as errors
RUSTFLAGS="-D warnings" $(CARGO) test --all-targets --all-features $(BUILD_JOBS)
RUSTFLAGS="-D warnings" $(CARGO) test --all-targets --all-features $(BUILD_JOBS)

target/%/$(APP): ## Build binary in debug or release mode
$(CARGO) build $(BUILD_JOBS) $(if $(findstring release,$(@)),--release) --bin $(APP)
$(CARGO) build $(BUILD_JOBS) $(if $(findstring release,$(@)),--release) --bin $(APP)

Comment on lines 21 to 23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Pattern-based release flag is fine but fragile.

$(findstring release,$(@)) works for the current tree, yet fails if a binary is ever named something-release. Guard with an explicit directory check for robustness.

-	$(CARGO) build $(BUILD_JOBS) $(if $(findstring release,$(@)),--release) --bin $(APP)
+	$(CARGO) build $(BUILD_JOBS) $(if $(filter target/release/%,$@),--release) --bin $(APP)
🤖 Prompt for AI Agents
In the Makefile at lines 21 to 23, the release flag detection uses `$(findstring
release,$(@))`, which can mistakenly trigger if the binary name contains
"release". To fix this, replace the string search with an explicit check that
the target directory is exactly "release" before adding the --release flag. This
ensures the release build flag is only applied when the directory part of the
target path is "release", avoiding false positives from binary names.

lint: ## Run Clippy with warnings denied
$(CARGO) clippy $(CLIPPY_FLAGS)

fmt: ## Format Rust and Markdown sources
$(CARGO) fmt --all
mdformat-all
$(CARGO) fmt --all
mdformat-all

check-fmt: ## Verify formatting
$(CARGO) fmt --all -- --check
$(CARGO) fmt --all -- --check

markdownlint: ## Lint Markdown files
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 $(MDLINT)
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 -- $(MDLINT)

nixie: ## Validate Mermaid diagrams
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 $(NIXIE)
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 -- $(NIXIE)

help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | \
Expand Down
Loading