Skip to content

Commit 466e195

Browse files
cursoragentlovasoa
andcommitted
Add clippy checks and suppress doctest warning
Co-authored-by: contact <[email protected]>
1 parent ef520b9 commit 466e195

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/sqlx.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- run: cargo fmt --all -- --check
1616

17+
clippy:
18+
name: Clippy
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
matrix:
22+
runtime: [async-std, tokio]
23+
tls: [native-tls, rustls]
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: Swatinem/rust-cache@v2
27+
- name: Run clippy for core with all features
28+
run: |
29+
cargo clippy --manifest-path sqlx-core/Cargo.toml \
30+
--no-default-features \
31+
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }} \
32+
-- -D warnings
33+
env:
34+
RUSTFLAGS: -D warnings
35+
- name: Run clippy for root with all features
36+
run: |
37+
cargo clippy \
38+
--no-default-features \
39+
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }},macros \
40+
-- -D warnings
41+
env:
42+
RUSTFLAGS: -D warnings
43+
- name: Run clippy for all targets
44+
run: |
45+
cargo clippy \
46+
--no-default-features \
47+
--all-targets \
48+
--features offline,all-databases,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }} \
49+
-- -D warnings
50+
env:
51+
RUSTFLAGS: -D warnings
52+
1753
check:
1854
name: Check
1955
runs-on: ubuntu-22.04
@@ -98,6 +134,27 @@ jobs:
98134
name: cargo-sqlx-${{ matrix.target }}
99135
path: ${{ matrix.bin }}
100136

137+
clippy-per-db:
138+
name: Clippy per Database
139+
runs-on: ubuntu-22.04
140+
strategy:
141+
matrix:
142+
db: [postgres, mysql, sqlite, mssql]
143+
runtime: [tokio]
144+
tls: [rustls]
145+
needs: clippy
146+
steps:
147+
- uses: actions/checkout@v4
148+
- uses: Swatinem/rust-cache@v2
149+
- name: Run clippy for ${{ matrix.db }}
150+
run: |
151+
cargo clippy \
152+
--no-default-features \
153+
--features ${{ matrix.db }},all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }},macros,migrate \
154+
-- -D warnings
155+
env:
156+
RUSTFLAGS: -D warnings
157+
101158
sqlite:
102159
name: SQLite
103160
runs-on: ubuntu-22.04

sqlx-core/src/arguments.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub trait IntoArguments<'q, DB: HasArguments<'q>>: Sized + Send {
2929

3030
// NOTE: required due to lack of lazy normalization
3131
#[allow(unused_macros)]
32+
#[allow(clippy::needless_doctest_main)]
3233
macro_rules! impl_into_arguments_for_arguments {
3334
($Arguments:path) => {
3435
impl<'q>

0 commit comments

Comments
 (0)