[PR #1862] [MERGED] Added test by a shell script static analysis tool(ShellCheck) #2217

Closed
opened 2026-03-04 02:04:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1862
Author: @ggtakec
Created: 1/16/2022
Status: Merged
Merged: 1/22/2022
Merged by: @gaul

Base: masterHead: add_shellcheck


📝 Commits (1)

  • d9d72d4 Added test by a shell script static analysis tool(ShellCheck)

📊 Changes

12 files changed (+877 additions, -739 deletions)

View changed files

📝 .github/workflows/ci.yml (+9 -1)
📝 .github/workflows/linux-ci-helper.sh (+46 -20)
📝 Makefile.am (+32 -0)
📝 autogen.sh (+6 -8)
📝 test/filter-suite-log.sh (+38 -36)
📝 test/integration-test-common.sh (+57 -47)
📝 test/integration-test-main.sh (+516 -482)
📝 test/junk_data.c (+9 -0)
📝 test/mergedir.sh (+51 -48)
📝 test/sample_delcache.sh (+26 -27)
📝 test/small-integration-test.sh (+7 -5)
📝 test/test-utils.sh (+80 -65)

📄 Description

Details

s3fs uses Bourne shell(sh) and bash for build and test.
However, these codes have not been tested except visually and directly at run time.

In the future, we will add new test and scripts for it, thus these test script codes should be checked/linted.
So I added it to my code to use ShellChek.
I think ShellCheck is popular and has a proven track record.

We can run ShellCheck with make shellcheck, just like cppcheck.
In this PR, the all script codes were corrected the errors and warnings detected by ShellCheck.
These code changes did not change the original logic.

Some errors and warnings cannot(should not) be fixed, then they have not done.
For that purpose, I use inline comment(# shellcheck disable=SCxxx) to suppress the output of ShellCheck.
The scripts used in s3fs are build and test, so I think that we won't need to take strict fix(ex. security issues).

The test on CentOS Stream 8 does not perform ShellCheck test because ShellCheck cannot be installed from the package.
Also, CentOS 7 ShellCheck is excluded because the version is low and the error(hGetContents: invalid argument (invalid byte sequence)) can not be resolved.
(Since we are checking with other OS, I think that it is not a problem not to implement it with CentOS 8/7.)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/1862 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 1/16/2022 **Status:** ✅ Merged **Merged:** 1/22/2022 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `add_shellcheck` --- ### 📝 Commits (1) - [`d9d72d4`](https://github.com/s3fs-fuse/s3fs-fuse/commit/d9d72d4b5b7fdaebc976fec812da8ca8c51bfe71) Added test by a shell script static analysis tool(ShellCheck) ### 📊 Changes **12 files changed** (+877 additions, -739 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+9 -1) 📝 `.github/workflows/linux-ci-helper.sh` (+46 -20) 📝 `Makefile.am` (+32 -0) 📝 `autogen.sh` (+6 -8) 📝 `test/filter-suite-log.sh` (+38 -36) 📝 `test/integration-test-common.sh` (+57 -47) 📝 `test/integration-test-main.sh` (+516 -482) 📝 `test/junk_data.c` (+9 -0) 📝 `test/mergedir.sh` (+51 -48) 📝 `test/sample_delcache.sh` (+26 -27) 📝 `test/small-integration-test.sh` (+7 -5) 📝 `test/test-utils.sh` (+80 -65) </details> ### 📄 Description ### Details s3fs uses Bourne shell(`sh`) and `bash` for build and test. However, these codes have not been tested except visually and directly at run time. In the future, we will add new test and scripts for it, thus these test script codes should be checked/linted. So I added it to my code to use [ShellChek](https://github.com/koalaman/shellcheck). I think `ShellCheck` is popular and has a proven track record. We can run `ShellCheck` with `make shellcheck`, just like `cppcheck`. In this PR, the all script codes were corrected the errors and warnings detected by `ShellCheck`. These code changes did not change the original logic. Some errors and warnings cannot(should not) be fixed, then they have not done. For that purpose, I use inline comment(`# shellcheck disable=SCxxx`) to suppress the output of `ShellCheck`. The scripts used in s3fs are build and test, so I think that we won't need to take strict fix(ex. security issues). The test on `CentOS Stream 8` does not perform `ShellCheck` test because `ShellCheck` cannot be installed from the package. Also, CentOS 7 ShellCheck is excluded because the version is low and the error(`hGetContents: invalid argument (invalid byte sequence)`) can not be resolved. (Since we are checking with other OS, I think that it is not a problem not to implement it with `CentOS 8/7`.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:04:23 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#2217
No description provided.