Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ jobs:
fi
echo "clean"

- name: Fail if a crate root lacks #![forbid(unsafe_code)]
run: |
set -euo pipefail
status=0
while IFS= read -r root; do
if ! grep -q '^#!\[forbid(unsafe_code)\]' "$root"; then
echo "::error file=$root::crate root is missing #![forbid(unsafe_code)]"
status=1
fi
done < <(find . -path ./target -prune -o \( -path '*/src/lib.rs' -o -path '*/src/main.rs' -o -path '*/src/bin/*.rs' -o -name build.rs \) -print)
exit $status

dependency-policy:
name: Dependency licenses & sources (cargo-deny)
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions fasterhenry-cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Bakes the source revision into `--version` via FASTERHENRY_GIT_DESCRIBE.
// Falls back to "unknown" where git is absent (a crates.io tarball build),
// so the version string stays deterministic there.
#![forbid(unsafe_code)]

use std::process::Command;

fn describe() -> String {
Expand Down
2 changes: 2 additions & 0 deletions fasterhenry-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//! The binary logic lives in this library so the tests can drive it without
//! spawning a process; `src/main.rs` is a thin wrapper.

#![forbid(unsafe_code)]

pub mod cli;
pub mod inp;
pub mod mat;
Expand Down
2 changes: 2 additions & 0 deletions fasterhenry-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//! the explicit `fasterhenry run <deck.inp | problem.json>`, which writes
//! one only when `--zc-mat` asks for it. See `--help`.

#![forbid(unsafe_code)]

use fasterhenry_cli::cli::{Invocation, RunArgs};
use fasterhenry_cli::inp::ParseOptions;
use fasterhenry_cli::spice::write_spice_subckt;
Expand Down
Loading