diff options
author | rtkay123 <dev@kanjala.com> | 2025-08-18 22:29:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-18 22:29:05 +0200 |
commit | 9c1aff826590c66bacfb6b6b9c0c65c839783383 (patch) | |
tree | fcabd15079fd014a7c8a2115444303bf9323d702 | |
parent | 60e0003ebb26ba31075ba047b6d15af1a4f29bbb (diff) | |
download | warden-9c1aff826590c66bacfb6b6b9c0c65c839783383.tar.bz2 warden-9c1aff826590c66bacfb6b6b9c0c65c839783383.zip |
-rw-r--r-- | .github/workflows/ci.yaml | 28 | ||||
-rw-r--r-- | crates/rule-executor/src/processor/rule/determine_outcome.rs | 14 | ||||
-rw-r--r-- | lib/warden-core/src/configuration/conv.rs | 2 | ||||
-rw-r--r-- | lib/warden-core/src/google/parser/money.rs | 2 |
4 files changed, 33 insertions, 13 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8183a72..64e9601 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,34 @@ concurrency: name: ci jobs: + clippy: + runs-on: ubuntu-latest + name: beta / clippy + steps: + - uses: actions/checkout@v5 + with: + submodules: true + - uses: dtolnay/rust-toolchain@master + with: + toolchain: beta + components: clippy,rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo install clippy-sarif sarif-fmt + - name: install protoc + uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Check + run: > + cargo clippy --workspace --all-features --all-targets --message-format=json + | clippy-sarif + | tee clippy-results.sarif + | sarif-fmt + - name: Upload + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: clippy-results.sarif + os-check: runs-on: ${{ matrix.os }} name: ${{ matrix.os }} / stable diff --git a/crates/rule-executor/src/processor/rule/determine_outcome.rs b/crates/rule-executor/src/processor/rule/determine_outcome.rs index e9113e4..727846d 100644 --- a/crates/rule-executor/src/processor/rule/determine_outcome.rs +++ b/crates/rule-executor/src/processor/rule/determine_outcome.rs @@ -72,9 +72,7 @@ mod tests { #[test] fn match_when_no_upper_limit() { - let bands = vec![ - make_band(Some(0.0), None, "A", "Above 0"), - ]; + let bands = vec![make_band(Some(0.0), None, "A", "Above 0")]; let mut rule_result = RuleResult::default(); determine_outcome(100, &bands, &mut rule_result); @@ -85,9 +83,7 @@ mod tests { #[test] fn match_when_no_lower_limit() { - let bands = vec![ - make_band(None, Some(50.0), "A", "Below 50"), - ]; + let bands = vec![make_band(None, Some(50.0), "A", "Below 50")]; let mut rule_result = RuleResult::default(); determine_outcome(-10, &bands, &mut rule_result); @@ -98,9 +94,7 @@ mod tests { #[test] fn match_when_no_limits() { - let bands = vec![ - make_band(None, None, "A", "Any value"), - ]; + let bands = vec![make_band(None, None, "A", "Any value")]; let mut rule_result = RuleResult::default(); determine_outcome(9999, &bands, &mut rule_result); @@ -122,6 +116,4 @@ mod tests { assert_eq!(rule_result.sub_rule_ref, "A"); assert_eq!(rule_result.reason, "Any value"); } - - } diff --git a/lib/warden-core/src/configuration/conv.rs b/lib/warden-core/src/configuration/conv.rs index 7f982b4..3b0fef9 100644 --- a/lib/warden-core/src/configuration/conv.rs +++ b/lib/warden-core/src/configuration/conv.rs @@ -266,7 +266,7 @@ mod tests { "x": 1, "y": [true, null, "str"], "z": { - "nested": 3.14 + "nested": 3.90 } }); diff --git a/lib/warden-core/src/google/parser/money.rs b/lib/warden-core/src/google/parser/money.rs index a703a4a..c12bfb1 100644 --- a/lib/warden-core/src/google/parser/money.rs +++ b/lib/warden-core/src/google/parser/money.rs @@ -172,7 +172,7 @@ mod tests { #[test] fn test_round_trip_conversion() { - let original = 1234.567_890_123; + let original = 1_234.567_890_123; let money = Money::try_from((original, "USD")).unwrap(); let back: f64 = money.into(); assert!( |