Skip to content

Commit 7f00edf

Browse files
committed
Add: cargo-semver-checks
This should prevent us from making semver incompatible changes without a required version bump.
1 parent 8284704 commit 7f00edf

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

‎default.nix‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ let
4747
# Rust build tools
4848
pkgs.cargo-audit
4949
pkgs.cargo-edit
50-
pkgs.cargo-insta
5150
pkgs.cargo-hakari
51+
pkgs.cargo-insta
5252
pkgs.cargo-nextest
53+
pkgs.cargo-semver-checks
5354
pkgs.maturin
5455

5556
# Resolve native sqlite from Nix for libsqlite3-sys

‎justfile‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ lint-light *ARGS:
8787
# Run the slow linters/static analysers that need to look at everything
8888
[group('lint')]
8989
[parallel]
90-
lint-heavy: clippy-fix lint-cargo mypy
90+
lint-heavy: semver clippy-fix lint-cargo mypy
9191

92-
# Serial execution on the main `CARGO_TARGET_DIR`
93-
[group('lint')]
94-
lint-cargo: clippy hakari
95-
96-
# Verify the workspace-hack crate is up to date
92+
# Verify the semver bounds are respected since the last tagged build
9793
[group('lint')]
98-
hakari:
99-
cargo hakari verify
94+
semver:
95+
#!/usr/bin/env bash
96+
set -euo pipefail
97+
export DATABASE_URL="sqlite://{{justfile_directory()}}/opsqueue/opsqueue_example_database_schema.db"
98+
cargo semver-checks --workspace --target x86_64-unknown-linux-gnu --baseline-rev "$(git tag -l --sort=-version:refname | head -1)"
10099
101100
# Rust static analysis
102101
[group('lint')]
@@ -106,6 +105,15 @@ clippy-fix:
106105
CARGO_TARGET_DIR=target/clippy-fix cargo clippy --no-deps --all-targets --no-default-features --fix --allow-dirty --allow-staged -- -Dwarnings
107106
CARGO_TARGET_DIR=target/clippy-fix cargo clippy --no-deps --all-targets --all-features --fix --allow-dirty --allow-staged -- -Dwarnings
108107

108+
# Serial execution on the main `CARGO_TARGET_DIR`
109+
[group('lint')]
110+
lint-cargo: clippy hakari
111+
112+
# Verify the workspace-hack crate is up to date
113+
[group('lint')]
114+
hakari:
115+
cargo hakari verify
116+
109117
# Rust static analysis
110118
[group('lint')]
111119
clippy:

0 commit comments

Comments
 (0)