Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Code Style Check

on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
- main

jobs:
backend-style:
name: Backend Ruff
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install backend dev dependencies
working-directory: backend
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt

- name: Run Ruff lint
working-directory: backend
run: python -m ruff check .

- name: Run Ruff format check
working-directory: backend
run: python -m ruff format --check .

frontend-style:
name: Frontend Prettier
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: frontend/package-lock.json

- name: Install frontend dependencies
working-directory: frontend
run: npm ci

- name: Run Prettier check
working-directory: frontend
run: npm run format:check

embedded-style:
name: Embedded clang-format
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format

- name: Run clang-format check
run: |
git ls-files 'embedded/ssccam/**/*.c' 'embedded/ssccam/**/*.h' \
| xargs clang-format --dry-run -Werror
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ uploaded_images/
.devcontainer/
.clangd
Kconfig.projbuild
node_modules/

# ========================================================================
# Python
Expand Down
Loading
Loading