Use ruff as linter and formatter #619
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Style | ||
on: [pull_request] | ||
jobs: | ||
formatting: | ||
name: CMake | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
sudo pip install cmake-format | ||
- name: Clang Format | ||
run: ./script/clang-format --check | ||
- name: CMake Format | ||
run: | | ||
find . -name 'CMakeLists.txt' -o -name '*.cmake' > cmake-src | ||
xargs cmake-format --check < cmake-src | ||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ["3.12"] | ||
- name: Run ruff | ||
run: | | ||
pip install ruff | ||
ruff check | ||
ruff format --check |