Skip to content

Commit 1d4c7a1

Browse files
committed
ci(lint): run clippy in release mode (#8541)
CI Clippy task catch lint errors which only appear in release mode (e.g. the one fixed in #8539). Add a profile for this. `cargo clippy --profile dev-no-debug-assertions` is about 35% faster than `cargo clippy --release` (and is slightly faster than plain `cargo clippy`) but catches the same problems. This slows down the Clippy CI task, but it still remains faster than running conformance, so I don't think it's likely to slow down CI overall.
1 parent 72f425f commit 1d4c7a1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ jobs:
162162
cache-key: clippy
163163
components: clippy
164164
- run: cargo lint -- -D warnings
165+
- run: cargo lint --profile dev-no-debug-assertions -- -D warnings
165166
- name: Check Char and Byte Offset
166167
run: |
167168
npm i @ast-grep/cli -g

Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,10 @@ codegen-units = 256 # Compile faster
247247
lto = "thin" # Faster compile time with thin LTO
248248
debug-assertions = true # Make sure `debug_assert!`s pass
249249
overflow-checks = true # Catch arithmetic overflow errors
250+
251+
# Profile for linting with release mode-like settings.
252+
# Catches lint errors which only appear in release mode.
253+
# `cargo lint --profile dev-no-debug-assertions` is about 35% faster than `cargo lint --release`.
254+
[profile.dev-no-debug-assertions]
255+
inherits = "dev"
256+
debug-assertions = false

0 commit comments

Comments
 (0)