From 8f51887ce9bbcd235b223583fe20e5ae4833bdcd Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Thu, 25 Sep 2025 13:24:00 +0200 Subject: [PATCH 1/2] Bash quotes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99f6101a..3978cfec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: run: | echo "### Here's how to fix the formatting locally:" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "```bash" >> $GITHUB_STEP_SUMMARY + echo '```bash' >> $GITHUB_STEP_SUMMARY echo "# Format all Swift files" >> $GITHUB_STEP_SUMMARY echo 'swift format -i --recursive .' >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY From 45869c9d4b8c655f79981446fbe09b145020fa9c Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Thu, 25 Sep 2025 13:25:36 +0200 Subject: [PATCH 2/2] apply format --- .../Tokenizers/String+PreTokenization.swift | 1 + Tests/TokenizersTests/ChatTemplateTests.swift | 1 + Tests/TokenizersTests/FactoryTests.swift | 1 + Tests/TokenizersTests/PreTokenizerTests.swift | 33 +++++++------------ 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Sources/Tokenizers/String+PreTokenization.swift b/Sources/Tokenizers/String+PreTokenization.swift index 54f875d0..3a91a3e5 100644 --- a/Sources/Tokenizers/String+PreTokenization.swift +++ b/Sources/Tokenizers/String+PreTokenization.swift @@ -1,4 +1,5 @@ import Foundation + import struct Hub.Config enum StringSplitPattern { diff --git a/Tests/TokenizersTests/ChatTemplateTests.swift b/Tests/TokenizersTests/ChatTemplateTests.swift index 2e0e57f3..c9245af1 100644 --- a/Tests/TokenizersTests/ChatTemplateTests.swift +++ b/Tests/TokenizersTests/ChatTemplateTests.swift @@ -7,6 +7,7 @@ import Foundation import Testing + @testable import Tokenizers @Suite("Chat Template Tests") diff --git a/Tests/TokenizersTests/FactoryTests.swift b/Tests/TokenizersTests/FactoryTests.swift index ad8cecbb..72a97c8f 100644 --- a/Tests/TokenizersTests/FactoryTests.swift +++ b/Tests/TokenizersTests/FactoryTests.swift @@ -8,6 +8,7 @@ import Foundation import Hub import Testing + @testable import Tokenizers private func makeHubApi() -> (api: HubApi, downloadDestination: URL) { diff --git a/Tests/TokenizersTests/PreTokenizerTests.swift b/Tests/TokenizersTests/PreTokenizerTests.swift index 13292a2a..1ef73900 100644 --- a/Tests/TokenizersTests/PreTokenizerTests.swift +++ b/Tests/TokenizersTests/PreTokenizerTests.swift @@ -179,64 +179,53 @@ struct PreTokenizerTests { @Test("Split behavior merged with previous") func splitBehaviorMergedWithPrevious() { #expect( - "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == - ["the-", "final-", "-", "countdown"] + "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == ["the-", "final-", "-", "countdown"] ) #expect( - "the-final--countdown-".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == - ["the-", "final-", "-", "countdown-"] + "the-final--countdown-".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == ["the-", "final-", "-", "countdown-"] ) #expect( - "the-final--countdown--".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == - ["the-", "final-", "-", "countdown-", "-"] + "the-final--countdown--".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == ["the-", "final-", "-", "countdown-", "-"] ) #expect( - "-the-final--countdown--".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == - ["-", "the-", "final-", "-", "countdown-", "-"] + "-the-final--countdown--".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == ["-", "the-", "final-", "-", "countdown-", "-"] ) #expect( - "--the-final--countdown--".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == - ["-", "-", "the-", "final-", "-", "countdown-", "-"] + "--the-final--countdown--".split(by: "-", options: .caseInsensitive, behavior: .mergedWithPrevious) == ["-", "-", "the-", "final-", "-", "countdown-", "-"] ) } @Test("Split behavior merged with next") func splitBehaviorMergedWithNext() { #expect( - "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == - ["the", "-final", "-", "-countdown"] + "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == ["the", "-final", "-", "-countdown"] ) #expect( - "-the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == - ["-the", "-final", "-", "-countdown"] + "-the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == ["-the", "-final", "-", "-countdown"] ) #expect( - "--the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == - ["-", "-the", "-final", "-", "-countdown"] + "--the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == ["-", "-the", "-final", "-", "-countdown"] ) #expect( - "--the-final--countdown-".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == - ["-", "-the", "-final", "-", "-countdown", "-"] + "--the-final--countdown-".split(by: "-", options: .caseInsensitive, behavior: .mergedWithNext) == ["-", "-the", "-final", "-", "-countdown", "-"] ) } @Test("Split behavior other") func splitBehaviorOther() { #expect( - "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .isolated) == - ["the", "-", "final", "-", "-", "countdown"] + "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .isolated) == ["the", "-", "final", "-", "-", "countdown"] ) #expect( - "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .removed) == - ["the", "final", "countdown"] + "the-final--countdown".split(by: "-", options: .caseInsensitive, behavior: .removed) == ["the", "final", "countdown"] ) }