Skip to content

added bonus foundation & overhaul of parser and errors #22

added bonus foundation & overhaul of parser and errors

added bonus foundation & overhaul of parser and errors #22

Workflow file for this run

name: Norminette check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
norminette:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for C and header files in diff
id: check_files
run: |
files=$(git diff --name-only HEAD~1 HEAD)
check=false
for file in $files; do
if [[ $file == *.c ]] || [[ $file == *.h ]]; then
check=true
break
fi
done
echo "check=$check" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
if: env.check == 'true'
- name: Install Norminette
run: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install norminette
if: env.check == 'true'
- name: Run Norminette
run: |
files=$(git diff --name-only HEAD~1 HEAD)
while read -r file; do
if [[ $file == *.c ]] || [[ $file == *.h ]]; then
norminette "$file"
# The script should fail if any error occurs
if [[ $? -ne 0 ]]; then
exit 1
fi
fi
done <<< "$files"
if: env.check == 'true'