Repository navigation
Lint (fix/loop-predictive-low-alarm) #482
Workflow file for this run
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: | |
| # Edits that don't change the base branch get their own group, so they never | |
| # cancel an in-flight lint run. | |
| group: lint-${{ github.ref }}${{ github.event.action == 'edited' && github.event.changes.base == null && format('-noop-{0}', github.run_id) || '' }} | |
| 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-26.04 | |
| container: swift:6.0 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Cache SwiftFormat build | |
| uses: actions/cache@v5 | |
| 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 |