From d6b0bda68db787f1cf16794da214e4a185ce6c07 Mon Sep 17 00:00:00 2001 From: LuisLiraC Date: Sun, 15 Sep 2024 09:40:29 -0600 Subject: [PATCH 1/2] Clippy command --- .github/workflows/clippy.yaml | 2 +- Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.github/workflows/clippy.yaml b/.github/workflows/clippy.yaml index 68bf289..613a5fb 100644 --- a/.github/workflows/clippy.yaml +++ b/.github/workflows/clippy.yaml @@ -51,4 +51,4 @@ jobs: ${{ runner.os }}-cargo-build- - name: Run Tests - run: cargo clippy --color always -- -Dwarnings -W clippy::pedantic + run: make clippy diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b17a67b --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +clippy: + cargo clippy --all-targets --color always -- -D warnings -W clippy::all \ No newline at end of file From ed10b9358a316da04b214a0aaab24d69ff6f24d3 Mon Sep 17 00:00:00 2001 From: LuisLiraC Date: Sun, 15 Sep 2024 09:41:11 -0600 Subject: [PATCH 2/2] clippy fix: bool_assert_comparison --- src/tests/unit.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/unit.rs b/src/tests/unit.rs index 05bb958..3ddfa0f 100644 --- a/src/tests/unit.rs +++ b/src/tests/unit.rs @@ -8,12 +8,12 @@ fn test_create_patterns_filters_single_line() { let filters = create_patterns_filters(arg); assert_eq!(filters.len(), 2); assert_eq!(filters[0].pattern, "*.rs"); - assert_eq!( - filters[0].exclude, false, + assert!( + !filters[0].exclude, "Expected 'exclude' to be false for pattern '*.rs'" ); assert_eq!(filters[1].pattern, "test/*.rs"); - assert_eq!(filters[1].exclude, true); + assert!(filters[1].exclude); } #[test]