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
11 changes: 11 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"MD004": { "style": "dash" },
"MD010": { "code_blocks": false },
"MD013": {
"line_length": 80,
"code_block_line_length": 120,
"tables": false,
"headings": false
},
"MD029": { "style": "ordered" }
}
147 changes: 147 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 17 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.PHONY: help all clean test build release lint fmt check-fmt markdownlint nixie publish-check typecheck install-smoke package-lints workflow-test workflow-test-deps verus kani verus-clone-detector kani-clone-detector

# Appended only on targets that invoke binaries commonly installed under these
# prefixes (cargo/bun/user-local), so the default recipe environment stays
# aligned with the caller's PATH.
TOOL_PATH_SUFFIX = $$HOME/.cargo/bin:$$HOME/.bun/bin:$$HOME/.local/bin

APP ?= whitaker-installer
CARGO ?= cargo
BUILD_JOBS ?=
Expand Down Expand Up @@ -30,13 +35,14 @@ clean: ## Remove build artifacts
$(CARGO) clean

test: ## Run tests with warnings treated as errors
@command -v cargo-nextest >/dev/null || { echo "Install cargo-nextest (cargo install cargo-nextest)"; exit 1; }
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; command -v cargo-nextest >/dev/null || { echo "Install cargo-nextest (cargo install cargo-nextest)"; exit 1; }
@# Prefer dynamic linking during local `cargo test` runs to avoid rustc_private
@# linkage pitfalls when building cdylib-based lints; `publish-check` omits
@# this flag to exercise production-like linking behaviour.
@# Run tests with backup/restore safeguard in a single shell with trap
@# to ensure cleanup runs even when tests fail.
@set -eu; \
export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; \
WHITAKER_BACKUP=""; \
HAD_WHITAKER=false; \
cleanup() { \
Expand Down Expand Up @@ -77,8 +83,8 @@ test: ## Run tests with warnings treated as errors
fi

workflow-test: workflow-test-deps ## Run opt-in GitHub workflow smoke tests with act + pytest
@command -v act >/dev/null || { echo "Install act to run workflow tests"; exit 1; }
@command -v $(UV) >/dev/null || { echo "uv is required for workflow tests"; exit 1; }
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; command -v act >/dev/null || { echo "Install act to run workflow tests"; exit 1; }
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; command -v $(UV) >/dev/null || { echo "uv is required for workflow tests"; exit 1; }
@test -x "$(WORKFLOW_TEST_VENV)/bin/python" || { \
echo "workflow-test virtualenv is missing or invalid:"; \
echo " expected: $(WORKFLOW_TEST_VENV)/bin/python"; \
Expand All @@ -88,9 +94,9 @@ workflow-test: workflow-test-deps ## Run opt-in GitHub workflow smoke tests with
@ACT_WORKFLOW_TESTS=1 $(WORKFLOW_TEST_VENV)/bin/python -m pytest tests/workflows

workflow-test-deps: ## Install Python dependencies for workflow tests
@command -v $(UV) >/dev/null || { echo "uv is required for workflow tests"; exit 1; }
@$(UV) venv --allow-existing $(WORKFLOW_TEST_VENV)
@$(UV) pip install --python $(WORKFLOW_TEST_VENV)/bin/python -r tests/workflows/requirements.txt
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; command -v $(UV) >/dev/null || { echo "uv is required for workflow tests"; exit 1; }
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; $(UV) venv --allow-existing $(WORKFLOW_TEST_VENV)
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; $(UV) pip install --python $(WORKFLOW_TEST_VENV)/bin/python -r tests/workflows/requirements.txt

target/%/$(APP): ## Build binary in debug or release mode
manifest=$$(grep -l whitaker-installer */Cargo.toml crates/*/Cargo.toml); \
Expand All @@ -102,18 +108,18 @@ lint: ## Run Clippy with warnings denied

fmt: ## Format Rust and Markdown sources
$(CARGO) fmt --all
mdformat-all
export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; mdformat-all

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

markdownlint: ## Lint Markdown files
$(MDLINT) '**/*.md'
export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; $(MDLINT) '**/*.md'

nixie:
# CI currently requires --no-sandbox; remove once nixie supports
# environment variable control for this option
nixie --no-sandbox
export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; $(NIXIE) --no-sandbox

typecheck:
RUSTFLAGS="-C prefer-dynamic -Z force-unstable-if-unmarked $(RUST_FLAGS)" $(CARGO) check $(CARGO_FLAGS)
Expand Down Expand Up @@ -145,7 +151,8 @@ install-smoke: ## Install whitaker-installer and verify basic functionality
whitaker-installer --version >/dev/null

publish-check: ## Build, test, and validate packages before publishing
@command -v cargo-nextest >/dev/null || { echo "Install cargo-nextest (cargo install cargo-nextest)"; exit 1; }
@export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; command -v cargo-nextest >/dev/null || { echo "Install cargo-nextest (cargo install cargo-nextest)"; exit 1; }
export PATH="$$PATH:$(TOOL_PATH_SUFFIX)"; \
PINNED_TOOLCHAIN=$$(awk -F '\"' '/^channel/ {print $$2}' rust-toolchain.toml); \
TOOLCHAIN="$$PINNED_TOOLCHAIN"; \
ORIG_DIR="$(CURDIR)"; \
Expand Down
1 change: 1 addition & 0 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ unic-langid = { workspace = true }
rstest = { workspace = true }
rstest-bdd = { workspace = true }
rstest-bdd-macros = { workspace = true }
proptest = "1"
regex = "1.10.4"
logtest = "2.0.0"

Expand Down
9 changes: 5 additions & 4 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ pub use i18n::{
pub use lcom4::{MethodInfo, MethodInfoBuilder, cohesion_components, collect_method_infos};
pub use path::SimplePath;
pub use rstest::{
ExpansionTrace, ParameterBinding, RstestDetectionOptions, RstestParameter, RstestParameterKind,
SpanRecoveryFrame, UserEditableSpan, classify_rstest_parameter, fixture_local_names,
is_rstest_fixture, is_rstest_fixture_with, is_rstest_test, is_rstest_test_with,
recover_user_editable_span,
ArgAtom, ArgFingerprint, CalleeShape, ExpansionTrace, ExprShape, LocalSlot,
ParagraphFingerprint, ParagraphNormalizer, ParameterBinding, RstestDetectionOptions,
RstestParameter, RstestParameterKind, SpanRecoveryFrame, StmtShape, UserEditableSpan,
classify_rstest_parameter, fixture_local_names, is_rstest_fixture, is_rstest_fixture_with,
is_rstest_test, is_rstest_test_with, recover_user_editable_span,
};
pub use span::{SourceLocation, SourceSpan, SpanError, span_line_count, span_to_lines};
Loading
Loading