forked from google/tf-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 869 Bytes
/
formatter.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Check formatting
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
formatter:
name: Check formatting of Python, C++, and Bazel files.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build wheel
shell: bash
run: |
bazelisk run //:bazel_formatter
bazelisk run //:python_formatter
bazelisk run //:clang_formatter
- name: Check if there is any change
id: changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Error if code has not been formatted
if: steps.changes.outputs.changed != 0
run: |
echo "Code has not been formatted. Please run the formatters as described by the README."
echo "Files changed:"
git status
return 1