mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-09-04 00:46:17 +00:00
Enforce formatting of C code in CI
This commit is contained in:
parent
2af2d313de
commit
96a9fce149
2 changed files with 6 additions and 0 deletions
3
.github/workflows/ci.py
vendored
3
.github/workflows/ci.py
vendored
|
|
@ -350,6 +350,9 @@ def main() -> None:
|
|||
raise SystemExit(q)
|
||||
if subprocess.run(['ruff', 'format', '--check']).returncode != 0:
|
||||
raise SystemExit('Some Python files are not formatted correctly')
|
||||
c_files = subprocess.check_output(['git', 'ls-files', '*.c', '*.h', '*.m']).decode().split()
|
||||
if c_files and subprocess.run(['clang-format', '--dry-run', '--Werror'] + c_files).returncode != 0:
|
||||
raise SystemExit('Some C/ObjC files are not formatted correctly')
|
||||
elif action == 'check-dependencies':
|
||||
check_dependencies()
|
||||
else:
|
||||
|
|
|
|||
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
|
@ -111,6 +111,9 @@ jobs:
|
|||
- name: Run ruff
|
||||
run: ruff check .
|
||||
|
||||
- name: Install clang-format
|
||||
run: sudo apt-get install -y clang-format
|
||||
|
||||
- name: Check code formatting
|
||||
run: go version && python .github/workflows/ci.py check_code_formatting
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue