Skip to content

Commit 12b7a44

Browse files
committed
Add soundness workflows
Adds CI to check for valid formatting and a variety of other checks.
1 parent aefbb6e commit 12b7a44

File tree

5 files changed

+111
-1
lines changed

5 files changed

+111
-1
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
validate_format_config:
11+
name: Validate Format Config
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Install apt dependencies
18+
run: sudo apt-get -qq update && sudo apt-get -qq -y install curl
19+
20+
- name: Compare against swift-mmio swift-format config
21+
run: |
22+
curl -sL https://raw.githubusercontent.com/apple/swift-mmio/refs/heads/main/.swift-format -o .swift-format-mmio
23+
diff .swift-format .swift-format-mmio
24+
25+
soundness:
26+
name: Soundness
27+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
28+
with:
29+
docs_check_enabled: false # bug: https://github.com/apple/swift-argument-parser/issues/704
30+
format_check_enabled: false # bug: https://github.com/apple/swift-argument-parser/issues/702
31+
license_header_check_enabled: false # feature: https://github.com/swiftlang/github-workflows/issues/78
32+
license_header_check_project_name: "Swift Argument Parser" # bug: https://github.com/swiftlang/github-workflows/issues/76
33+
shell_check_enabled: false # bug: https://github.com/apple/swift-argument-parser/issues/703

.spi.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ version: 1
22
builder:
33
configs:
44
- documentation_targets: [ArgumentParser]
5-

.swift-format

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"indentation" : {
6+
"spaces" : 2
7+
},
8+
"indentConditionalCompilationBlocks" : false,
9+
"indentSwitchCaseLabels" : false,
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
14+
"lineLength" : 80,
15+
"maximumBlankLines" : 1,
16+
"multiElementCollectionTrailingCommas" : true,
17+
"noAssignmentInExpressions" : {
18+
"allowedFunctions" : [
19+
"XCTAssertNoThrow"
20+
]
21+
},
22+
"prioritizeKeepingFunctionOutputTogether" : false,
23+
"respectsExistingLineBreaks" : true,
24+
"rules" : {
25+
"AllPublicDeclarationsHaveDocumentation" : false,
26+
"AlwaysUseLowerCamelCase" : true,
27+
"AmbiguousTrailingClosureOverload" : false,
28+
"BeginDocumentationCommentWithOneLineSummary" : false,
29+
"DoNotUseSemicolons" : true,
30+
"DontRepeatTypeInStaticProperties" : true,
31+
"FileScopedDeclarationPrivacy" : true,
32+
"FullyIndirectEnum" : true,
33+
"GroupNumericLiterals" : true,
34+
"IdentifiersMustBeASCII" : true,
35+
"NeverForceUnwrap" : true,
36+
"NeverUseForceTry" : true,
37+
"NeverUseImplicitlyUnwrappedOptionals" : true,
38+
"NoAccessLevelOnExtensionDeclaration" : true,
39+
"NoAssignmentInExpressions" : true,
40+
"NoBlockComments" : false,
41+
"NoCasesWithOnlyFallthrough" : true,
42+
"NoEmptyTrailingClosureParentheses" : true,
43+
"NoLabelsInCasePatterns" : true,
44+
"NoLeadingUnderscores" : false,
45+
"NoParensAroundConditions" : true,
46+
"NoPlaygroundLiterals" : true,
47+
"NoVoidReturnOnFunctionSignature" : true,
48+
"OmitExplicitReturns" : true,
49+
"OneCasePerLine" : true,
50+
"OneVariableDeclarationPerLine" : true,
51+
"OnlyOneTrailingClosureArgument" : true,
52+
"OrderedImports" : true,
53+
"ReplaceForEachWithForLoop" : true,
54+
"ReturnVoidInsteadOfEmptyTuple" : true,
55+
"TypeNamesShouldBeCapitalized" : true,
56+
"UseEarlyExits" : true,
57+
"UseLetInEveryBoundCaseVariable" : true,
58+
"UseShorthandTypeNames" : true,
59+
"UseSingleLinePropertyGetter" : true,
60+
"UseSynthesizedInitializer" : true,
61+
"UseTripleSlashForDocumentationComments" : true,
62+
"UseWhereClausesInForLoops" : false,
63+
"ValidateDocumentationComments" : true
64+
},
65+
"spacesBeforeEndOfLineComments": 2,
66+
"spacesAroundRangeFormationOperators" : false,
67+
"tabWidth" : 2,
68+
"version" : 1
69+
}

.unacceptablelanguageignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore this file which references the "master" branch of another repo
2+
Tools/generate-manual/MDoc/MDocMacro.swift

0 commit comments

Comments
 (0)