chore: improve clippy CI
All checks were successful
Code quality / check (pull_request) Successful in 3m43s

This commit is contained in:
Naxdy 2024-10-14 17:18:45 +02:00
parent e15a7c7bec
commit a63983f90c
Signed by: Naxdy
GPG key ID: CC15075846BCE91B
4 changed files with 22 additions and 10 deletions

View file

@ -25,4 +25,4 @@ jobs:
- name: Run Clippy
run: |
nix develop . --command cargo clippy -- -Dwarnings
nix build .#clippy --print-build-logs -j auto

View file

@ -22,6 +22,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build firmware image
run: |
nix build .#clippy -o clippy
nix build .# -o dist --print-build-logs
- name: (Re-)generate tag
run: |

View file

@ -54,18 +54,26 @@
${pkgs.elf2uf2-rs}/bin/elf2uf2-rs ${self.packages.${system}.naxgcc-fw}/bin/${self.packages.${system}.naxgcc-fw.pname} $out/bin/${self.packages.${system}.naxgcc-fw.pname}.uf2
'';
packages.naxgcc-fw = naersk_lib.buildPackage {
pname = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
packages.naxgcc-fw = pkgs.callPackage
({ mode ? "build" }: naersk_lib.buildPackage {
pname = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
src = self;
inherit mode;
cargoBuildOptions = _orig: _orig ++ [
"--target=${CARGO_BUILD_TARGET}"
];
src = self;
# if a tree falls in the forest and no one is around to hear it, does it make a sound?
DEFMT_LOG = "off";
cargoBuildOptions = _orig: _orig ++ [
"--target=${CARGO_BUILD_TARGET}"
];
# if a tree falls in the forest and no one is around to hear it, does it make a sound?
DEFMT_LOG = "off";
})
{ };
packages.clippy = self.packages.${system}.naxgcc-fw.override {
mode = "clippy";
};
devShells.default = pkgs.mkShell {

View file

@ -130,6 +130,9 @@ impl MyDeviceHandler {
impl Handler for MyDeviceHandler {
fn enabled(&mut self, enabled: bool) {
self.configured = true;
// reason: in production, info! compiles to nothing
#[allow(clippy::if_same_then_else)]
if enabled {
info!("Device enabled");
} else {