Skip to content

Code style

Code style #690

Workflow file for this run

name: Code style
on:
schedule:
# run daily 20:00 on main branch
- cron: '0 20 * * *'
push:
branches:
- prerelease_test
pull_request:
jobs:
cmake_checks:
name: Check CMake files
runs-on: ubuntu-20.04
steps:
- name: Install prerequisites
run: pip install cmakelang
- name: Checkout source
uses: actions/checkout@v2
- name: Run format on CMake files
run: |
find -name CMakeLists.txt -exec cmake-format -i {} +
find src test tsl -name '*.cmake' -exec cmake-format -i {} +
- name: Check for diff
run: git diff --exit-code
perl_checks:
name: Check Perl code in tree
runs-on: ubuntu-20.04
steps:
- name: Install prerequisites
run: sudo apt install perltidy
- name: Checkout source
uses: actions/checkout@v2
- name: Format Perl files, if needed
run: find . -name '*.p[lm]' -exec perltidy --profile=scripts/perltidyrc {} +
- name: Check for diff
run: git diff --exit-code
misc_checks:
name: Check formatting, license, update scripts and git hooks
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Checkout source
if: always()
uses: actions/checkout@v2
- name: Check license
if: always()
run: ./scripts/check_license_all.sh
- name: Check git commit hooks
if: always()
run: |
python2 ./scripts/githooks/commit_msg_tests.py
python3 ./scripts/githooks/commit_msg_tests.py
- name: Check for unreferenced test files
if: always()
run: ./scripts/check_unreferenced_files.sh
- name: Check code formatting
if: always()
run: |
sudo apt install clang-format-8
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-8
./scripts/clang_format_all.sh
git diff --exit-code
- name: Check update scripts
if: always()
run: ./scripts/check_update_scripts.sh