Lint (swift-charts-migration) #197
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| run-name: Lint (${{ github.head_ref || github.ref_name }}) | |
| on: | |
| pull_request: | |
| # 'edited' so the lint re-runs when a PR's base branch is changed; otherwise | |
| # retargeting (e.g. main -> dev) leaves the required SwiftFormat check with no | |
| # run on the new base and the PR stays blocked indefinitely. | |
| types: [opened, synchronize, reopened, edited] | |
| workflow_dispatch: | |
| concurrency: | |
| group: lint-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| swiftformat: | |
| name: SwiftFormat | |
| # Run on open/sync/reopen always; on 'edited' only when the base branch | |
| # actually changed, so routine title/description edits don't re-lint. | |
| if: ${{ github.event.action != 'edited' || github.event.changes.base != null }} | |
| runs-on: ubuntu-latest | |
| container: swift:6.0 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Cache SwiftFormat build | |
| uses: actions/cache@v4 | |
| with: | |
| path: BuildTools/.build | |
| key: ${{ runner.os }}-swiftformat-${{ hashFiles('BuildTools/Package.resolved', 'BuildTools/Package.swift') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swiftformat- | |
| - name: SwiftFormat --lint | |
| run: | | |
| swift run -c release --package-path BuildTools swiftformat . \ | |
| --lint \ | |
| --header "LoopFollow\n{file}" \ | |
| --exclude Pods,Generated,R.generated.swift,fastlane/swift,Dependencies,dexcom-share-client-swift |