Skip to content

Commit aac8370

Browse files
committed
Improve check script to allow running just some checks.
1 parent 799c9f1 commit aac8370

File tree

12 files changed

+137
-41
lines changed

12 files changed

+137
-41
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ jobs:
2828
- name: Install cargo plugins
2929
run: |
3030
cargo install cargo-rdme
31+
cargo install cargo-machete
32+
cargo install taplo-cli
3133
cargo install cargo-deadlinks
3234
3335
- name: Checkout repository
3436
uses: actions/checkout@v4
3537

3638
- name: Check everything
37-
run: bash ./tools/check.sh
39+
run: bash ./tools/check.sh basic doc_url_links unused_deps packaging fmt toml_fmt readme
3840

3941
- name: Code coverage
4042
if: ${{ runner.os == 'Linux' }}
@@ -57,4 +59,17 @@ jobs:
5759
uses: actions/checkout@v4
5860

5961
- name: Check the minimum supported rust version
60-
run: cargo msrv verify
62+
run: bash ./tools/check.sh msrv
63+
64+
clippy:
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Install rust
69+
uses: dtolnay/rust-toolchain@stable
70+
71+
- name: Checkout repository
72+
uses: actions/checkout@v4
73+
74+
- name: Run clippy
75+
run: bash ./tools/check.sh clippy

.taplo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
include = ["**/*.toml"]
2+
exclude = ["target/**"]
3+
4+
[formatting]
5+
column_width = 100
6+
indent_string = ' '
7+
allowed_blank_lines = 1
8+
9+
[[rule]]
10+
formatting = { reorder_keys = true }
11+
keys = [
12+
"workspace.dependencies",
13+
"dependencies",
14+
"dev-dependencies",
15+
"build-dependencies",
16+
"lints.clippy",
17+
]

Cargo.toml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,8 @@ repository = "https://github.com/orium/rpds"
1212
documentation = "https://docs.rs/rpds"
1313
readme = "README.md"
1414

15-
keywords = [
16-
"data-structure",
17-
"data-structures",
18-
"persistent",
19-
"immutable",
20-
"no_std"
21-
]
22-
categories = [
23-
"data-structures",
24-
]
15+
keywords = ["data-structure", "data-structures", "persistent", "immutable", "no_std"]
16+
categories = ["data-structures"]
2517

2618
license = "MPL-2.0"
2719

@@ -57,17 +49,19 @@ std = []
5749

5850
[lints.clippy]
5951
all = { level = "warn", priority = -2 }
60-
pedantic = { level = "warn", priority = -2 }
6152
correctness = { level = "deny", priority = -1 }
53+
pedantic = { level = "warn", priority = -2 }
6254

6355
enum-glob-use = "allow"
6456
if-not-else = "allow"
6557
match-bool = "allow"
6658
match-same-arms = "allow"
6759
missing-panics-doc = "allow"
6860
module-name-repetitions = "allow"
61+
multiple-bound-locations = "allow"
6962
similar-names = "allow"
7063
single-match-else = "allow"
64+
struct-field-names = "allow"
7165
type-complexity = "allow"
7266
type-repetition-in-bounds = "allow"
7367
unnested-or-patterns = "allow"

benches/std_btree_map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
7+
#![allow(clippy::cast_possible_wrap)]
78

89
use criterion::{criterion_group, criterion_main, Criterion};
910
use std::collections::BTreeMap;

benches/std_hash_map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
7+
#![allow(clippy::cast_possible_wrap)]
78

89
use criterion::{criterion_group, criterion_main, Criterion};
910
use std::collections::HashMap;

src/list/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ where
185185

186186
pub fn drop_first_mut(&mut self) -> bool {
187187
self.head.take().map_or(false, |h| {
188-
self.head = h.next.clone();
188+
self.head.clone_from(&h.next);
189189
self.length -= 1;
190190

191191
if self.length == 0 {

src/map/hash_trie_map/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ mod node_utils {
236236
}
237237

238238
pub fn hash<T: ?Sized + Hash, H: BuildHasher>(v: &T, hasher_builder: &H) -> HashValue {
239-
hasher_builder.hash_one(&v)
239+
hasher_builder.hash_one(v)
240240
}
241241
}
242242

@@ -873,6 +873,7 @@ where
873873
self.size() == 0
874874
}
875875

876+
#[allow(clippy::iter_without_into_iter)]
876877
pub fn iter(&self) -> Iter<'_, K, V, P> {
877878
self.iter_ptr().map(|e| (&e.key, &e.value))
878879
}

src/map/hash_trie_map/test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
44
*/
55

6+
#![allow(clippy::cast_possible_truncation)]
7+
#![allow(clippy::cast_possible_wrap)]
8+
#![allow(clippy::cast_sign_loss)]
9+
610
use super::*;
711
use pretty_assertions::assert_eq;
812
use static_assertions::assert_impl_all;

src/map/red_black_tree_map/test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
44
*/
55

6+
#![allow(clippy::cast_possible_truncation)]
7+
#![allow(clippy::cast_possible_wrap)]
8+
#![allow(clippy::cast_sign_loss)]
9+
610
use super::*;
711
use alloc::vec::Vec;
812
use pretty_assertions::assert_eq;

src/set/hash_trie_set/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ where
247247
self.size() == 0
248248
}
249249

250+
#[allow(clippy::iter_without_into_iter)]
250251
pub fn iter(&self) -> Iter<'_, T, P> {
251252
self.map.keys()
252253
}

0 commit comments

Comments
 (0)