Skip to content

Commit 1781c8f

Browse files
committed
fix: adjust nox sessions for rust formatting and linting to actually install dependencies
1 parent bfc177d commit 1781c8f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

{{cookiecutter.project_name}}/noxfile.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ def format_python(session: Session) -> None:
9999
@nox.session(python=False, name="format-rust", tags=[FORMAT, RUST])
100100
def format_rust(session: Session) -> None:
101101
"""Run Rust code formatter (cargo fmt)."""
102-
session.log("Installing formatting dependencies...")
103-
session.run("cargo", "install", "cargo-fmt", external=True)
104-
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
105-
session.run("cargo", "fmt", "--all", "--", "--write", external=True)
102+
session.log("Ensuring rustfmt component is available...")
103+
session.run("rustup", "component", "add", "rustfmt", external=True)
104+
session.log("Formatting Rust code...")
105+
session.run("cargo", "fmt", "--all", external=True)
106106

107107

108108
{% endif -%}
@@ -117,10 +117,10 @@ def lint_python(session: Session) -> None:
117117
@nox.session(python=False, name="lint-rust", tags=[LINT, RUST])
118118
def lint_rust(session: Session) -> None:
119119
"""Run Rust code linters (cargo clippy)."""
120-
session.log("Installing linting dependencies...")
121-
session.run("cargo", "install", "cargo-clippy", external=True)
122-
session.run("cargo", "clippy", "--all-features", "--", "--check", external=True)
123-
session.run("cargo", "clippy", "--all-features", "--", "--write", external=True)
120+
session.log("Ensuring clippy component is available...")
121+
session.run("rustup", "component", "add", "clippy", external=True)
122+
session.log("Running clippy lints...")
123+
session.run("cargo", "clippy", "--all-features", "--", "-D", "warnings", external=True)
124124

125125

126126
{% endif -%}

0 commit comments

Comments
 (0)