Skip to content

Commit

Permalink
Merge branch 'add shellcheck lint' into dev-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Sep 6, 2023
2 parents caab849 + 096758a commit 7957c34
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Quickstart for GitHub Actions
# https://docs.github.com/en/actions/quickstart

name: Lint
on: [ push, pull_request, workflow_dispatch ]

jobs:

test:
runs-on: ubuntu-latest
timeout-minutes: 5
name: Lint

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: test-cases/lint.sh
1 change: 1 addition & 0 deletions bin/xpf
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ portableReadLink() {
THIS_SCRIPT="$(portableReadLink "${BASH_SOURCE[0]}")"
BASE_DIR="$(dirname "$THIS_SCRIPT")"

# shellcheck disable=SC1091
source "$BASE_DIR/xpl" "$@"
10 changes: 10 additions & 0 deletions test-cases/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eEuo pipefail

# cd to the root of the project
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/..

find bin lib legacy-bin -type f |
grep -Pv '/show-duplicate-java-classes$' |
grep -Pv '/\.editorconfig$' |
xargs shellcheck --shell=bash

0 comments on commit 7957c34

Please sign in to comment.