diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml new file mode 100644 index 0000000..8c838e8 --- /dev/null +++ b/.github/workflows/clang-format-check.yml @@ -0,0 +1,20 @@ +name: clang-format check + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "*" ] + workflow_dispatch: + +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.13.0 + with: + clang-format-version: '16' + check-path: 'src/pbrt' diff --git a/src/pbrt/euclidean_space/bounds2.h b/src/pbrt/euclidean_space/bounds2.h index bbe5244..ea598f2 100644 --- a/src/pbrt/euclidean_space/bounds2.h +++ b/src/pbrt/euclidean_space/bounds2.h @@ -23,7 +23,7 @@ class Bounds2 { PBRT_CPU_GPU Bounds2(Point2 p1, Point2 p2) : p_min(p1.min(p2)), p_max(p1.max(p2)) {} - + PBRT_CPU_GPU Vector2 Diagonal() const { return p_max - p_min;