Skip to content

Commit 7c72b6b

Browse files
committed
chore: make AI review happy
1 parent 2edd30c commit 7c72b6b

File tree

9 files changed

+21
-11
lines changed

9 files changed

+21
-11
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea
2+
.DS_Store
3+
/data
4+
.trustify
5+
/target
6+
/.dockerignore
7+
/Containerfile

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
/dump.sql
1919
.ai_history.txt
2020
/vendor/
21-
/vendor.toml
21+
/vendor.toml

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ petgraph = { version = "0.8.0", features = ["serde-1"] }
110110
quick-xml = "0.39.0"
111111
rand = "0.10.0"
112112
regex = "1.10.3"
113-
reqwest = { version = "0.13.1", features = ["blocking", "form", "json", "query"] }
113+
reqwest = "0.13"
114114
ring = "0.17.8"
115115
roxmltree = "0.21.1"
116116
rstest = "0.26.1"
@@ -213,4 +213,4 @@ csaf = { git = "https://github.com/scm-rs/csaf-rs", branch = "main" }
213213
#osv = { git = "https://github.com/ctron/osv", branch = "feature/drop_deps_1" }
214214

215215
# required due to https://github.com/doubleopen-project/spdx-rs/pull/35
216-
spdx-rs = { git = "https://github.com/ctron/spdx-rs", branch = "feature/add_alias_2" }
216+
spdx-rs = { git = "https://github.com/ctron/spdx-rs", branch = "feature/add_alias_2" }

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,4 @@ CPE (Product?) and/or pURLs described by the SBOM
279279
## Related links
280280

281281
* [Trustify scale test results](https://guacsec.github.io/trustify-scale-test-runs/)
282-
* [Trustify benchmark results](https://guacsec.github.io/trustify/dev/bench/)
282+
* [Trustify benchmark results](https://guacsec.github.io/trustify/dev/bench/)

etc/trustify-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ clap = { workspace = true, features = ["derive", "env"] }
1313
dotenvy = { workspace = true }
1414
futures = { workspace = true }
1515
indicatif = { workspace = true }
16-
reqwest = { workspace = true, features = ["blocking", "json"] }
16+
reqwest = { workspace = true, features = ["form"] }
1717
serde = { workspace = true , features = ["derive"] }
1818
serde_json = { workspace = true }
1919
thiserror = { workspace = true }

etc/trustify-cli/src/api/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum ApiError {
1818
#[error("HTTP {0}: {1}")]
1919
HttpError(u16, String),
2020

21-
#[error("HTTP 404: Resource not found")]
21+
#[error("HTTP 404: Resource not found {0}")]
2222
NotFound(String),
2323

2424
#[error("HTTP 401: Please check your authentication credentials")]
@@ -43,7 +43,7 @@ pub enum ApiError {
4343
impl From<reqwest::Error> for ApiError {
4444
fn from(e: reqwest::Error) -> Self {
4545
if e.is_timeout() {
46-
ApiError::Timeout(0) // 0 indicates network-level timeout (no HTTP response)
46+
ApiError::Timeout(e.status().unwrap_or(StatusCode::REQUEST_TIMEOUT).as_u16()) // 0 indicates network-level timeout (no HTTP response)
4747
} else if e.is_connect() {
4848
ApiError::NetworkError(format!("Connection failed: {}", e))
4949
} else if e.is_request() {

etc/trustify-cli/src/commands/sbom.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ fn format_list_output(json: &str, format: &ListFormat) -> anyhow::Result<ExitCod
291291
})
292292
})
293293
.collect();
294-
println!("{}", serde_json::to_string(&result).unwrap_or_default());
294+
let json = serde_json::to_string(&result)
295+
.map_err(|e| anyhow::anyhow!("Failed to serialize output: {}", e))?;
296+
println!("{}", json);
295297
Ok(ExitCode::SUCCESS)
296298
}
297299
ListFormat::Short => {
@@ -308,7 +310,9 @@ fn format_list_output(json: &str, format: &ListFormat) -> anyhow::Result<ExitCod
308310
})
309311
})
310312
.collect();
311-
println!("{}", serde_json::to_string(&result).unwrap_or_default());
313+
let json = serde_json::to_string(&result)
314+
.map_err(|e| anyhow::anyhow!("Failed to serialize output: {}", e))?;
315+
println!("{}", json);
312316
Ok(ExitCode::SUCCESS)
313317
}
314318
}

0 commit comments

Comments
 (0)