Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ on:
pull_request:
branches: [main]

env:
RUST_VERSION: 1.86.0

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- name: build
run: cargo build --verbose
- name: test
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ on:
tags:
- v*

env:
RUST_VERSION: 1.86.0

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Publish to crates.io
run: |
cargo publish \
Expand Down Expand Up @@ -41,7 +46,9 @@ jobs:
TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: add target
run: rustup target add $TARGET
- name: build
Expand All @@ -62,7 +69,9 @@ jobs:
TARGET: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: add target
run: rustup target add $env:TARGET
- name: build
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ readme = "README.md"
keywords = ["soup", "iec62304", "compliance", "traceability"]
license = "MIT"

edition = "2021"
edition = "2024"
rust-version = "1.86.0"

[dependencies]
clap = { version = "4.5.36", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::Parser;
use serde_json::{json, Map, Value};
use serde_json::{Map, Value, json};
use std::{env, path, process};

mod parse;
Expand Down
2 changes: 1 addition & 1 deletion src/parse/csproj.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::SoupParse;
use crate::soup::model::{Soup, SoupSourceParseError};
use quick_xml::events::Event;
use quick_xml::Reader;
use quick_xml::events::Event;
use serde_json::{Map, Value};
use std::collections::{BTreeSet, HashMap};

Expand Down
2 changes: 1 addition & 1 deletion src/parse/package_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl SoupParse for PackageJson {
Err(e) => {
return Err(SoupSourceParseError {
message: format!("Invalid package.json structure ({})", e),
})
});
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/scan/dir_scan.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
parse::{
apt::Apt, cargo::Cargo, csproj::CsProj, docker_base::DockerBase, package_json::PackageJson,
SoupParse,
SoupParse, apt::Apt, cargo::Cargo, csproj::CsProj, docker_base::DockerBase,
package_json::PackageJson,
},
soup::model::{Soup, SoupContexts, SouperIoError},
utils,
Expand Down Expand Up @@ -39,7 +39,7 @@ pub fn scan(
Err(e) => {
return Err(SouperIoError {
message: format!("Not able to read file: {} ({})", path.display(), e),
})
});
}
};
let parse_results: Result<Vec<_>, _> = parsers
Expand Down Expand Up @@ -125,7 +125,7 @@ fn relative_path<P: AsRef<Path>>(full_path: P, root_path: P) -> Result<String, S
Err(_) => {
return Err(SouperIoError {
message: "Not able to convert relative path to string".to_string(),
})
});
}
};
let relative_path = relative_path.replace('\\', "/");
Expand Down
2 changes: 1 addition & 1 deletion src/soup/contexts_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl SoupContexts {
Err(e) => {
return Err(SouperIoError {
message: format!("Not able to serialize to json: {}", e),
})
});
}
};
match writer.write_all(json.as_bytes()) {
Expand Down