{{ message }}
Repository navigation
Add shellcheck, SwiftFormat and SwiftLint #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| # These jobs only read the tree. The repository default is write, so scope the | ||
| # token down explicitly rather than inheriting more than is needed. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| shell: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| with: | ||
| persist-credentials: false | ||
|
|
||
| # prepareTestResults.sh is load-bearing: CI and every contributor run it to | ||
| # generate the test fixtures, and nothing checked it before. | ||
| - name: ShellCheck | ||
| run: | | ||
| shellcheck --version | ||
| find . -name '*.sh' -not -path './.build/*' -print0 | xargs -0 -r shellcheck | ||
|
|
||
| swift: | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install linters | ||
| run: brew install swiftformat swiftlint | ||
|
|
||
| - name: SwiftFormat | ||
| run: swiftformat --lint --reporter github-actions-log . | ||
|
|
||
| # Non-strict on purpose: warnings are surfaced, only violations configured | ||
| # as errors fail the build. The config starts green so the gate is trusted, | ||
| # and is meant to be tightened deliberately rather than switched on already | ||
| # failing and then ignored. | ||
| - name: SwiftLint | ||
| run: swiftlint lint --reporter github-actions-logging | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Starting configuration. The intent is a gate that is green today and can be | ||
| # tightened deliberately, rather than one that is switched on already failing | ||
| # and therefore ignored. | ||
|
|
||
| included: | ||
| - Sources | ||
| - Tests | ||
| - XCTestHTMLReportSampleApp | ||
|
|
||
| excluded: | ||
| - .build | ||
| # Generated (carries a DO NOT EDIT header) and almost entirely multiline | ||
| # string literals holding the emitted HTML. Also excluded from SwiftFormat. | ||
| - Sources/XCTestHTMLReportCore/Classes/HTMLTemplates.swift | ||
|
|
||
| disabled_rules: | ||
| # SwiftFormat owns layout; running both would mean two tools disagreeing | ||
| # about the same lines. | ||
| - trailing_comma | ||
| - trailing_whitespace | ||
| - opening_brace | ||
| - statement_position | ||
| # TODOs are tracked as GitHub issues in this repo, not as lint failures. | ||
| - todo | ||
|
|
||
| line_length: | ||
| # SwiftFormat wraps at 100, but it cannot wrap string literals or long | ||
| # identifiers, so the error threshold sits above that rather than failing | ||
| # on lines no formatter can fix. | ||
| warning: 120 | ||
| error: 200 | ||
| ignores_comments: true | ||
| ignores_urls: true | ||
|
|
||
| identifier_name: | ||
| # Short names are idiomatic in this codebase's closures and generics. | ||
| min_length: | ||
| warning: 2 | ||
| error: 1 | ||
| excluded: | ||
| - id | ||
| - to | ||
| - i |
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.

Uh oh!
There was an error while loading. Please reload this page.