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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
env:
CS_ACCESS_TOKEN: ${{ secrets.CS_ACCESS_TOKEN }}
CODESCENE_CLI_SHA256: ${{ vars.CODESCENE_CLI_SHA256 }}
WHITAKER_INSTALLER_VERSION: '0.2.5'
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
Expand Down Expand Up @@ -41,6 +42,29 @@ jobs:
- name: Run ruff
run: make lint

- name: Cache Whitaker installer
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/bin/whitaker-installer
~/.cache/cargo-binstall
key: whitaker-installer-${{ runner.os }}-${{ runner.arch }}-${{ env.WHITAKER_INSTALLER_VERSION }}

- name: Install Whitaker
run: |
if ! command -v whitaker-installer >/dev/null 2>&1; then
if cargo binstall --version >/dev/null 2>&1; then
cargo binstall --no-confirm --locked "whitaker-installer@${WHITAKER_INSTALLER_VERSION}"
else
echo "cargo-binstall unavailable; building whitaker-installer from crates.io"
cargo install --locked whitaker-installer --version "${WHITAKER_INSTALLER_VERSION}"
fi
fi
whitaker-installer
Comment thread
leynos marked this conversation as resolved.

- name: Run Rust lint
run: make lint-rust

- name: Run typechecker
run: make typecheck

Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MDLINT ?= markdownlint-cli2
NIXIE ?= nixie
MDFORMAT_ALL ?= mdformat-all
CARGO ?= cargo
WHITAKER ?= whitaker
RUFF_VERSION ?= 0.15.12
RUFF = $(UV_ENV) uv tool run --from ruff==$(RUFF_VERSION) ruff
TOOLS = $(MDFORMAT_ALL) ty $(MDLINT) uv
Expand All @@ -17,7 +19,7 @@ PYLINT_PYPY_SHIM_REF ?= 726d09f968b4d729ee4b29c71fc732e744854f3b
PYLINT_PYPY_SHIM = git+https://github.com/leynos/pylint-pypy-shim.git@$(PYLINT_PYPY_SHIM_REF)
PYLINT = $(UV_ENV) uv tool run --python $(PYLINT_PYTHON) --from '$(PYLINT_PYPY_SHIM)' pylint-pypy

.PHONY: help all clean build build-release lint fmt check-fmt \
.PHONY: help all clean build build-release lint lint-rust fmt check-fmt \
markdownlint nixie test typecheck $(TOOLS) $(VENV_TOOLS)

.DEFAULT_GOAL := all
Expand Down Expand Up @@ -79,6 +81,10 @@ lint: uv ## Run linters
$(RUFF) check
$(PYLINT) $(PYLINT_TARGETS)

lint-rust: ## Lint the Rust workspace (Clippy and Whitaker)
$(CARGO) clippy --manifest-path rust/Cargo.toml --all-targets --all-features -- -D warnings
cd rust && RUSTFLAGS="-D warnings" $(WHITAKER) --all -- --all-targets --all-features

typecheck: build ty ## Run typechecking
ty --version
ty check
Expand Down
5 changes: 5 additions & 0 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ For Rust extension changes, also run:

- `cargo fmt --manifest-path rust/Cargo.toml --check`: verify Rust formatting.
- `cargo check --manifest-path rust/Cargo.toml`: typecheck the Rust workspace.
- `make lint-rust`: run Clippy and the
[Whitaker Dylint suite](https://github.com/leynos/whitaker) over the Rust
workspace with warnings denied. The `whitaker` wrapper must be on `PATH`;
install it with
`cargo install --locked whitaker-installer && whitaker-installer`.

For Markdown-only changes, run:

Expand Down
Loading