chore: improve clippy CI
All checks were successful
Code quality / check (pull_request) Successful in 3m43s
All checks were successful
Code quality / check (pull_request) Successful in 3m43s
This commit is contained in:
parent
e15a7c7bec
commit
a63983f90c
4 changed files with 22 additions and 10 deletions
|
@ -25,4 +25,4 @@ jobs:
|
||||||
|
|
||||||
- name: Run Clippy
|
- name: Run Clippy
|
||||||
run: |
|
run: |
|
||||||
nix develop . --command cargo clippy -- -Dwarnings
|
nix build .#clippy --print-build-logs -j auto
|
||||||
|
|
|
@ -22,6 +22,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build firmware image
|
- name: Build firmware image
|
||||||
run: |
|
run: |
|
||||||
|
nix build .#clippy -o clippy
|
||||||
nix build .# -o dist --print-build-logs
|
nix build .# -o dist --print-build-logs
|
||||||
- name: (Re-)generate tag
|
- name: (Re-)generate tag
|
||||||
run: |
|
run: |
|
||||||
|
|
26
flake.nix
26
flake.nix
|
@ -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
|
${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 {
|
packages.naxgcc-fw = pkgs.callPackage
|
||||||
pname = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
|
({ mode ? "build" }: naersk_lib.buildPackage {
|
||||||
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
|
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 ++ [
|
src = self;
|
||||||
"--target=${CARGO_BUILD_TARGET}"
|
|
||||||
];
|
|
||||||
|
|
||||||
# if a tree falls in the forest and no one is around to hear it, does it make a sound?
|
cargoBuildOptions = _orig: _orig ++ [
|
||||||
DEFMT_LOG = "off";
|
"--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 {
|
devShells.default = pkgs.mkShell {
|
||||||
|
|
|
@ -130,6 +130,9 @@ impl MyDeviceHandler {
|
||||||
impl Handler for MyDeviceHandler {
|
impl Handler for MyDeviceHandler {
|
||||||
fn enabled(&mut self, enabled: bool) {
|
fn enabled(&mut self, enabled: bool) {
|
||||||
self.configured = true;
|
self.configured = true;
|
||||||
|
|
||||||
|
// reason: in production, info! compiles to nothing
|
||||||
|
#[allow(clippy::if_same_then_else)]
|
||||||
if enabled {
|
if enabled {
|
||||||
info!("Device enabled");
|
info!("Device enabled");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue