Skip to content
Permalink
Browse files

Fix indentation test

  • Loading branch information
m-kuhn committed May 11, 2020
1 parent 91c79f4 commit d877d310b5e99bb95bd78ebc13eaa2182e948779
Showing with 9 additions and 11 deletions.
  1. +4 −1 .github/workflows/code_layout.yml
  2. +5 −10 scripts/verify_indentation.sh
@@ -95,12 +95,15 @@ jobs:
run: ./tests/code_layout/test_doxygen_layout.sh

indentation_check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Indentation Test
run: ./scripts/verify_indentation.sh
run: ./scripts/verify_indentation.sh ${{ github.event.pull_request.head.sha }}..${{ github.event.pull_request.base.sha }}

spell_check:
runs-on: ubuntu-latest
@@ -3,8 +3,9 @@ cd $(git rev-parse --show-toplevel)

export PATH=$PATH:$PWD/scripts

if [ -z "$TRAVIS_COMMIT_RANGE" ]; then
echo "No commit range given"
if [ -z "$1" ]; then
echo "No commit range given. "
echo " Usage: ./scripts/verify_indentation [HEAD_REF]..[BASE_REF]"
exit 0
fi

@@ -19,14 +20,8 @@ ASTYLEDIFF=/tmp/astyle.diff
true > $ASTYLEDIFF


if [[ -n $TRAVIS_PULL_REQUEST_BRANCH ]]; then
# if on a PR, just analyze the changed files
echo "TRAVIS PR BRANCH: $TRAVIS_PULL_REQUEST_BRANCH"
FILES=$(git diff --diff-filter=AM --name-only $(git merge-base HEAD ${TRAVIS_BRANCH}) | tr '\n' ' ' )
elif [[ -n $TRAVIS_COMMIT_RANGE ]]; then
echo "TRAVIS COMMIT RANGE: $TRAVIS_COMMIT_RANGE"
FILES=$(git diff --diff-filter=AM --name-only ${TRAVIS_COMMIT_RANGE/.../..} | tr '\n' ' ' )
fi
echo "Commit range: $1"
FILES=$(git diff --diff-filter=AM --name-only $1 | tr '\n' ' ' )

for f in $FILES; do
if ! [ -f "$f" ]; then

0 comments on commit d877d31

Please sign in to comment.
You can’t perform that action at this time.