Skip to content

Commit bc4175f

Browse files
authored
Update CI workflow to run swift format lint in strict mode (#255)
* Update ci.yml * Enable strict lint checks * Fix NoBlockComments linter errors
1 parent d907980 commit bc4175f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit Tests
1+
name: CI
22

33
on:
44
# This runs in the context of the base of the pull request,
@@ -11,7 +11,8 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
build-and-test:
14+
test:
15+
name: Test
1516
uses: huggingface/hf-workflows/.github/workflows/swift_transformers_unit_tests.yml@main
1617
with:
1718
# Use the PR merge ref, not the head.
@@ -26,7 +27,7 @@ jobs:
2627
- uses: actions/checkout@v4
2728

2829
- run: |
29-
swift format lint --recursive .
30+
swift format lint --strict --recursive .
3031
3132
- name: Suggest fixes (if check fails)
3233
if: failure()

Tests/TokenizersTests/TokenizerTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ struct TokenizerTests {
140140
let tokenizer = tokenizerOpt!
141141

142142
// These are two different characters
143-
let cases = ["" /* 0x61 0x300 */, "à" /* 0xe0 */]
143+
let cases = [
144+
"", // 0x61 0x300
145+
"à", // 0xe0
146+
]
144147
let expected = [217138, 1305]
145148
for (s, expected) in zip(cases, expected) {
146149
let encoded = tokenizer.encode(text: " " + s)

0 commit comments

Comments
 (0)