summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThayne McCombs <astrothayne@gmail.com>2024-04-15 00:17:20 -0600
committerGitHub <noreply@github.com>2024-04-15 00:17:20 -0600
commitbc6782624ef8d886c267c0f698e3895d9657df0e (patch)
tree2e6dd87a0bb559755cb7f253ceb8ad56cd7d9858
parent3cd73d79272206f25c86d1a30538402cbecf8b78 (diff)
parentcf6ff87c7df1a568559ca031be14fda613a1bab5 (diff)
Merge pull request #1520 from tmccombs/clippy
Add clippy using latest rust version to CI
-rw-r--r--.github/workflows/CICD.yml10
-rw-r--r--tests/tests.rs4
2 files changed, 13 insertions, 1 deletions
diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml
index 92a777e..c07c41c 100644
--- a/.github/workflows/CICD.yml
+++ b/.github/workflows/CICD.yml
@@ -44,6 +44,16 @@ jobs:
- uses: actions/checkout@v4
- run: cargo fmt -- --check
+ lint_check:
+ name: Ensure 'cargo clippy' has no warnings
+ runs-on: ubuntu-latest
+ steps:
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ components: clippy
+ - uses: actions/checkout@v4
+ - run: cargo clippy --all-targets --all-features -- -Dwarnings
+
min_version:
name: Minimum supported rust version
runs-on: ubuntu-20.04
diff --git a/tests/tests.rs b/tests/tests.rs
index 1edbeae..ba83141 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1311,7 +1311,8 @@ fn test_type_executable() {
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
fs::OpenOptions::new()
- .create(true)
+ .create_new(true)
+ .truncate(true)
.write(true)
.mode(0o777)
.open(te.test_root().join("executable-file.sh"))
@@ -1319,6 +1320,7 @@ fn test_type_executable() {
fs::OpenOptions::new()
.create(true)
+ .truncate(true)
.write(true)
.mode(0o645)
.open(te.test_root().join("not-user-executable-file.sh"))