2023-10-24 19:38:27 -04:00
|
|
|
name: Format
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
clang-format:
|
2024-01-11 04:46:37 -05:00
|
|
|
name: 'C++'
|
2023-10-24 19:38:27 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-01-24 21:16:29 -05:00
|
|
|
- uses: actions/checkout@v4
|
2023-10-24 19:38:27 -04:00
|
|
|
|
|
|
|
- name: Run clang-format
|
|
|
|
run: |
|
2024-01-08 04:58:49 -05:00
|
|
|
find LEGO1 ISLE -iname '*.h' -o -iname '*.cpp' | xargs \
|
2023-10-24 19:38:27 -04:00
|
|
|
pipx run "clang-format>=17,<18" \
|
|
|
|
--style=file \
|
2024-01-08 04:58:49 -05:00
|
|
|
-i
|
2024-02-02 20:03:52 -05:00
|
|
|
git diff --exit-code
|
2023-11-25 13:27:42 -05:00
|
|
|
|
|
|
|
python-format:
|
2024-01-11 04:46:37 -05:00
|
|
|
name: 'Python'
|
2023-11-25 13:27:42 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-01-24 21:16:29 -05:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-25 13:27:42 -05:00
|
|
|
|
|
|
|
- name: Install python libraries
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-01-26 12:03:29 -05:00
|
|
|
pip install black==23.* pylint==3.* pytest==7.* -r tools/requirements.txt
|
2023-11-25 13:27:42 -05:00
|
|
|
|
|
|
|
- name: Run pylint and black
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-12-13 05:48:14 -05:00
|
|
|
pylint tools --ignore=build,ncc
|
|
|
|
black --check tools --exclude=ncc
|