Skip to content

Commit

Permalink
Fix incomplete application of Clippy configuration in x helper script.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreichold committed Oct 3, 2023
1 parent 2df6cba commit 06a93f1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion benches/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn from_vec3_large(bencher: &mut Bencher) {
from_vec3(bencher, 2_usize.pow(5));
}

fn iter_with_gil(bencher: &mut Bencher, mut f: impl FnMut(Python)) {
fn iter_with_gil(bencher: &mut Bencher, mut f: impl FnMut(Python<'_>)) {
Python::with_gil(|py| {
bencher.iter(|| {
let pool = unsafe { py.new_pool() };
Expand Down
35 changes: 22 additions & 13 deletions x.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,40 @@ def gen_examples(manifest):
yield dir_ / manifest


LINT_CONFIG = (
"--deny",
"warnings",
# We usually want to make the GIL lifetime explicit.
"--deny",
"elided-lifetimes-in-paths",
"--allow",
"clippy::needless-lifetimes",
)


def default(args):
format_(args)

if nightly():
run("cargo", "clippy", "--all-features", "--tests", "--benches")
run(
"cargo",
"clippy",
"--all-features",
"--tests",
"--benches",
"--",
*LINT_CONFIG,
)
else:
run("cargo", "clippy", "--all-features", "--tests")
run("cargo", "clippy", "--all-features", "--tests", "--", *LINT_CONFIG)

for manifest in gen_examples("Cargo.toml"):
run("cargo", "clippy", "--manifest-path", manifest)
run("cargo", "clippy", "--manifest-path", manifest, "--", *LINT_CONFIG)

run("cargo", "test", "--all-features", "--lib", "--tests")


def check(args):
LINT_CONFIG = (
"--deny",
"warnings",
# We usually want to make the GIL lifetime explicit.
"--deny",
"elided-lifetimes-in-paths",
"--allow",
"clippy::needless-lifetimes",
)

run("cargo", "fmt", "--", "--check")

run(
Expand Down

0 comments on commit 06a93f1

Please sign in to comment.