Skip to content

Commit 7b410d8

Browse files
authored
Fix noformat_file / format_file discrepenency on iOS headers (#397)
In `scripts/format_code.py` the format code path correctly ignored Objective C headers. However in no-format code path reported that some Objective C headers required formatting. This PR fixes that discrepancy. Additionally reordered the workflow steps so that the format check is the first check returned. I felt like there's a usability problem with the label checks failing which isn't a hard failure, and it being the first reported result. People clicking through to the Github Action log should see the actionable hard failures first.
1 parent d002a9d commit 7b410d8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.github/workflows/checks.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ env:
1111
statusLabelFailed: "tests: failed"
1212

1313
jobs:
14-
check_integration_test_labels:
15-
# This check fails if integration tests are queued, in progress, or failed.
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: docker://agilepathway/pull-request-label-checker:latest
19-
with:
20-
none_of: "${{ env.statusLabelInProgress }},${{ env.statusLabelFailed }},${{ env.triggerLabelFull }},${{ env.triggerLabelQuick }}"
21-
repo_token: ${{ github.token }}
2214
file_format_check:
2315
runs-on: ubuntu-latest
2416
steps:
@@ -40,5 +32,14 @@ jobs:
4032
- name: Detect Formatting Changes
4133
shell: bash
4234
run: python3 scripts/format_code.py -git_diff -noformat_file -verbose
35+
36+
check_integration_test_labels:
37+
# This check fails if integration tests are queued, in progress, or failed.
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: docker://agilepathway/pull-request-label-checker:latest
41+
with:
42+
none_of: "${{ env.statusLabelInProgress }},${{ env.statusLabelFailed }},${{ env.triggerLabelFull }},${{ env.triggerLabelQuick }}"
43+
repo_token: ${{ github.token }}
4344

4445

scripts/format_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def main(argv):
241241
else:
242242
count = 0
243243
for filename in filenames:
244-
if does_file_need_formatting(filename):
244+
if does_file_need_formatting(filename) and not is_file_objc_header(filename):
245245
exit_code = 1
246246
count += 1
247247
if FLAGS.verbose:

0 commit comments

Comments
 (0)