Skip to content

Commit

Permalink
Run black and flake8 on every PR
Browse files Browse the repository at this point in the history
TODO: Figure out what to do with all the existing errors...
  • Loading branch information
tekknolagi committed May 24, 2023
1 parent aa922d6 commit fc6e694
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,23 @@ jobs:

lint:
runs-on: ubuntu-20.04
# TODO(max): Install and run Black on Python code
steps:
- name: Install clang-format
run: sudo apt install -y clang-format
- name: Install tools
run: sudo apt install -y clang-format black flake8
- uses: actions/checkout@v3
- name: Run clang-format
working-directory: ${{github.workspace}}
run: |
find capi ext runtime -type f \( -name '*.c' -o -name '*.h' -o -name '*.cpp' \) \
! -wholename 'runtime/unicode-db.cpp' \
-exec clang-format --dry-run --Werror '{}' ';'
- name: Run black
working-directory: ${{github.workspace}}
run: black --check --target-version=py38 library/builtins.py
- name: Run flake8
working-directory: ${{github.workspace}}
run: |
# Black allows 88 chars per line by default
flake8 --max-line-length=88 \
--extend-exclude=library/test/test_compiler/sbs_code_tests,library/test/test_compiler/testcorpus \
library

0 comments on commit fc6e694

Please sign in to comment.