-
Notifications
You must be signed in to change notification settings - Fork 0
Enforce Oxford spelling #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,22 @@ | ||
| .PHONY: help all clean test test-workflow-contracts build release lint typecheck fmt check-fmt markdownlint nixie bless | ||
| .PHONY: help all clean test test-workflow-contracts build release lint typecheck \ | ||
| fmt check-fmt markdownlint nixie spelling spelling-helper-test bless | ||
|
|
||
| APP ?= lag-complexity | ||
| APP ?= lagc | ||
| CARGO ?= cargo | ||
| BUILD_JOBS ?= | ||
| CLIPPY_FLAGS ?= --all-targets --all-features -- -D warnings | ||
| MDLINT ?= markdownlint-cli2 | ||
| NIXIE ?= nixie | ||
| WHITAKER ?= whitaker | ||
| UV ?= uv | ||
| UV_ENV = UV_CACHE_DIR=.uv-cache UV_TOOL_DIR=.uv-tools | ||
| RUFF_VERSION ?= 0.15.12 | ||
| TYPOS_VERSION ?= 1.48.0 | ||
|
|
||
| build: target/debug/$(APP) ## Build debug binary | ||
| release: target/release/$(APP) ## Build release binary | ||
|
|
||
| all: release ## Default target builds release binary | ||
| all: release spelling ## Build the release binary and enforce spelling | ||
|
|
||
| clean: ## Remove build artifacts | ||
| $(CARGO) clean | ||
|
|
@@ -39,9 +44,31 @@ fmt: ## Format Rust and Markdown sources | |
| check-fmt: ## Verify formatting | ||
| $(CARGO) fmt --all -- --check | ||
|
|
||
| markdownlint: ## Lint Markdown files | ||
| markdownlint: spelling ## Lint Markdown files and enforce spelling | ||
| find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 $(MDLINT) | ||
|
|
||
| spelling: spelling-helper-test ## Enforce en-GB-oxendict spelling in Markdown prose | ||
| @$(UV_ENV) $(UV) run scripts/generate_typos_config.py | ||
| @git ls-files -z '*.md' | \ | ||
| xargs -0 -r env $(UV_ENV) $(UV) tool run typos@$(TYPOS_VERSION) \ | ||
| --config typos.toml --force-exclude | ||
|
Comment on lines
+51
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a PR changes Useful? React with 👍 / 👎. |
||
|
|
||
| spelling-helper-test: ## Validate the shared spelling-policy integration | ||
| @$(UV_ENV) $(UV) tool run ruff@$(RUFF_VERSION) format --isolated \ | ||
| --target-version py313 --check scripts/generate_typos_config.py \ | ||
| scripts/typos_rollout.py scripts/typos_rollout_cache.py \ | ||
| scripts/tests/test_typos_rollout.py | ||
| @$(UV_ENV) $(UV) tool run ruff@$(RUFF_VERSION) check --isolated \ | ||
| --target-version py313 scripts/generate_typos_config.py \ | ||
| scripts/typos_rollout.py scripts/typos_rollout_cache.py \ | ||
| scripts/tests/test_typos_rollout.py | ||
| @PYTHONPATH=scripts $(UV_ENV) $(UV) run --no-project --python 3.13 \ | ||
| --with pytest==9.0.2 --with pytest-cov==7.0.0 \ | ||
| python -m pytest scripts/tests/test_typos_rollout.py \ | ||
| -c /dev/null --rootdir=. -p no:cacheprovider \ | ||
| --cov=generate_typos_config --cov=typos_rollout \ | ||
| --cov=typos_rollout_cache --cov-fail-under=90 | ||
|
|
||
| nixie: ## Validate Mermaid diagrams | ||
| # CI currently requires --no-sandbox; remove once nixie supports | ||
| # environment variable control for this option | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a PR changes
typos.local.tomlor the shared dictionary advances, this target rewrites the trackedtypos.tomland then immediately runstyposagainst that uncommitted output. Because the recipe never checksgit diff --exit-code typos.tomlafter regeneration, CI can pass while the committed generated config remains stale, leaving fresh or offline checkouts to use a different spelling policy than the one CI validated.Useful? React with 👍 / 👎.