Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default-filter = "not (binary(behaviour_toolchain) | binary(behaviour_cli) | kin
[profile.ci]
default-filter = "not kind(example)"

# Serialise dylint UI tests that build lint libraries and use
# Serialize dylint UI tests that build lint libraries and use
# `#[serial]`. nextest runs each test in its own process, so the
# `serial_test` crate's in-process mutex has no effect. A test-group
# with max-threads = 1 prevents concurrent lint-library builds from
Expand Down Expand Up @@ -49,7 +49,7 @@ retries = { backoff = "exponential", count = 2, delay = "5s" }
slow-timeout = { period = "10m", terminate-after = 1 }

[[profile.default.overrides]]
# Serialise ignored exclusion integration tests when they are explicitly run.
# Serialize ignored exclusion integration tests when they are explicitly run.
# They build and stage the lint library before invoking `cargo dylint`, so they
# share the same target-directory race risk as the UI harnesses above.
filter = "binary(integration_exclusion)"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
BUILD_PROFILE: debug
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
WHITAKER_INSTALLER_VERSION: '0.2.7'
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
SCCACHE_GHA_ENABLED: "true"
Expand Down Expand Up @@ -129,6 +130,26 @@ jobs:
!**/.uv-cache/**
!**/.uv-tools/**

- 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

- name: Lint
run: make lint

Expand Down
26 changes: 26 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
unstable_features = true
comment_width = 100
format_code_in_doc_comments = true
imports_granularity = "Crate"
imports_layout = "HorizontalVertical"
wrap_comments = true
group_imports = "StdExternalCrate"
use_try_shorthand = true
hex_literal_case = "Lower"
format_strings = true
format_macro_matchers = true
fn_single_line = true
condense_wildcard_suffixes = true
use_field_init_shorthand = true

# Dylint UI fixtures are test data, not source: their `.stderr` expectations
# match compiler output byte for byte, including line and column numbers.
# Reformatting them (for example `format_strings` splitting a long `reason`
# across lines) silently shifts those spans and breaks the UI tests. Fixtures
# under `ui/` are already immune because they are not Cargo targets; these are
# targets, so exclude them explicitly.
ignore = [
"crates/no_expect_outside_tests/examples",
"crates/no_unwrap_or_else_panic/examples",
"crates/rstest_helper_should_be_fixture/examples",
]
24 changes: 18 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,30 @@ project:
- `make lint` executes:

```sh
cargo clippy --workspace --all-targets --all-features -- -D warnings
RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo doc --workspace --no-deps
cargo clippy --workspace --lib --bins --tests --benches --all-features \
-- -D warnings
whitaker --all -- -p whitaker-common -p whitaker-installer \
-p whitaker_clones_core -p whitaker_sarif --all-targets --all-features
```

linting every target with all features enabled and denying all Clippy
warnings.
- `make test` executes:
building rustdoc with warnings denied, linting every target except the
Dylint UI fixtures under `examples/` (which deliberately contain the
anti-patterns the suite detects, so the workspace policy cannot apply to
them) with all features enabled and denying all Clippy warnings, and
running the
Whitaker Dylint suite over the support crates (install via
`cargo install whitaker-installer && whitaker-installer`). `make
lint-clippy` runs the rustdoc and Clippy subset; `make lint-whitaker`
runs the Whitaker subset.
- `make test` executes `cargo nextest run` over the CI crate subset and
then the workspace doctests:

```sh
cargo test --workspace
RUSTFLAGS="-D warnings" cargo test --workspace --doc --all-features
```

running the full workspace test suite. Use `make fmt`
running the full workspace test suite including doctests. Use `make fmt`
(`cargo fmt --workspace`) to apply formatting fixes reported by the
formatter check.
- Clippy warnings MUST be disallowed.
Expand Down
Loading
Loading