Skip to content

DRT: Fix track assignment spacing cost #22393

DRT: Fix track assignment spacing cost

DRT: Fix track assignment spacing cost #22393

name: Format Code with pre commit trigger
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
Clang-Format:
runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }}
steps:
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
- name: Check format of cpp changed files
run: |
clang-format --version
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ "${file##*.}" =~ ^(h|C|cc|cp|cpp|c++|CPP|cxx|hh)$ \
&& "${file}" != "src/sta/"* \
&& "${file}" != "src/odb/src/codeGenerator/"* \
&& "${file}" != "third-party/"* ]]; then
clang-format --dry-run --Werror $file
fi
done