Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/test_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ jobs:
fail-fast: false # don't cancel if a job from the matrix fails
matrix:
config: [
astyle-cleanliness,
check_autotest_options,
logger_metadata,
param_parse,
param-file-validation,
python-cleanliness,
astyle-cleanliness,
shellcheck,
validate_board_list,
logger_metadata,
param-file-validation,
]
steps:
# git checkout the PR
Expand All @@ -28,8 +29,8 @@ jobs:
submodules: 'recursive'
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip' # caching pip dependencies
python-version: 3.x
cache: pip # caching pip dependencies
Comment on lines +32 to +33
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid patches unrelated to the PR topic,as good as they might be.

pip-install: flake8 lxml pexpect

- name: Install astyle
Expand All @@ -38,6 +39,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y astyle

- name: Install shellcheck
if: matrix.config == 'shellcheck'
shell: bash
run: |
sudo apt-get update
sudo apt-get install --yes shellcheck

- name: test ${{matrix.config}}
env:
CI_BUILD_TARGET: ${{matrix.config}}
Expand Down
14 changes: 14 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://www.shellcheck.net -- 'shellcheck --help'
# https://github.com/koalaman/shellcheck
# 'find . -type f -name "*.sh" -exec shellcheck --severity=error {} +'

# Minimum severity of errors to consider (error, warning, info, style)
severity=error

# To improve our code quality, comment out one for the following and create a pull request:
disable=SC1087 # 2 instances
disable=SC2068 # 4 instances
disable=SC2071 # 2 instances
disable=SC2145 # 1 instance
disable=SC2148 # 3 instances
disable=SC2173 # 1 instance
8 changes: 8 additions & 0 deletions Tools/scripts/build_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,14 @@ for t in $CI_BUILD_TARGET; do
continue
fi

if [ "$t" == "shellcheck" ]; then
echo "Running shellcheck on scripts"

# Ignore scripts in the modules directory
find . -path ./modules -prune -o -type f -name '*.sh' -exec shellcheck --severity=error '{}' +
continue
fi

if [ "$t" == "param-file-validation" ]; then
echo "Testing param check script"
./Tools/scripts/param_check_unittests.py
Expand Down
Loading