Skip to content

Commit

Permalink
Format and gh action (#9)
Browse files Browse the repository at this point in the history
* format files, add GH action
* remove force try
* add .unacceptablelanguageignore
  • Loading branch information
GErP83 authored Nov 5, 2024
1 parent ced1af6 commit 614eef4
Show file tree
Hide file tree
Showing 21 changed files with 467 additions and 232 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Actions

on:
pull_request:
branches:
- main

jobs:

bb_checks:
name: BB Checks
uses: BinaryBirds/github-workflows/.github/workflows/extra_soundness.yml@main
with:
local_swift_dependencies_check_enabled : true

swiftlang_checks:
name: Swiftlang Checks
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "Testify"
format_check_enabled : true
broken_symlink_check_enabled : true
unacceptable_language_check_enabled : true
api_breakage_check_enabled : false
docs_check_enabled : false
license_header_check_enabled : false
shell_check_enabled : false
yamllint_check_enabled : false
python_lint_check_enabled : false

swiftlang_tests:
name: Swiftlang Tests
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
enable_windows_checks : false
linux_build_command: "swift test --parallel"
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.0\"}]"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/.build
/Packages
/*.xcodeproj
.vscode/launch.json
64 changes: 64 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 1,
"lineLength": 80,
"maximumBlankLines": 1,
"fileScopedDeclarationPrivacy": {
"accessLevel": "private"
},
"tabWidth": 4,
"indentation": {
"spaces": 4
},
"indentConditionalCompilationBlocks": false,
"indentSwitchCaseLabels": false,
"lineBreakAroundMultilineExpressionChainComponents": true,
"lineBreakBeforeControlFlowKeywords": true,
"lineBreakBeforeEachArgument": true,
"lineBreakBeforeEachGenericRequirement": true,
"prioritizeKeepingFunctionOutputTogether": false,
"respectsExistingLineBreaks": true,
"spacesAroundRangeFormationOperators": false,
"multiElementCollectionTrailingCommas": true,
"rules": {
"AllPublicDeclarationsHaveDocumentation": false,
"AlwaysUseLiteralForEmptyCollectionInit": true,
"AlwaysUseLowerCamelCase": true,
"AmbiguousTrailingClosureOverload": true,
"BeginDocumentationCommentWithOneLineSummary": true,
"DoNotUseSemicolons": true,
"DontRepeatTypeInStaticProperties": true,
"FileScopedDeclarationPrivacy": true,
"FullyIndirectEnum": true,
"GroupNumericLiterals": true,
"IdentifiersMustBeASCII": true,
"NeverForceUnwrap": false,
"NeverUseForceTry": true,
"NeverUseImplicitlyUnwrappedOptionals": true,
"NoAccessLevelOnExtensionDeclaration": true,
"NoAssignmentInExpressions": true,
"NoBlockComments": true,
"NoCasesWithOnlyFallthrough": true,
"NoEmptyTrailingClosureParentheses": true,
"NoLabelsInCasePatterns": true,
"NoLeadingUnderscores": true,
"NoParensAroundConditions": true,
"NoPlaygroundLiterals": true,
"NoVoidReturnOnFunctionSignature": true,
"OmitExplicitReturns": true,
"OneCasePerLine": true,
"OneVariableDeclarationPerLine": true,
"OnlyOneTrailingClosureArgument": true,
"OrderedImports": true,
"ReplaceForEachWithForLoop": true,
"ReturnVoidInsteadOfEmptyTuple": true,
"TypeNamesShouldBeCapitalized": true,
"UseEarlyExits": true,
"UseLetInEveryBoundCaseVariable": true,
"UseShorthandTypeNames": true,
"UseSingleLinePropertyGetter": true,
"UseSynthesizedInitializer": true,
"UseTripleSlashForDocumentationComments": true,
"UseWhereClausesInForLoops": true,
"ValidateDocumentationComments": true
}
}
2 changes: 2 additions & 0 deletions .swiftformatignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Package.swift
Package@swift-5.9.swift
10 changes: 10 additions & 0 deletions .unacceptablelanguageignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Tests/TestifySDKTests/Resources/Assets/json/Kitura.json
Tests/TestifySDKTests/Resources/Assets/json/Kitura-coverage.json
Tests/TestifySDKTests/Resources/Assets/json/PromiseFailure.json
Tests/TestifySDKTests/Resources/Assets/json/Shell-coverage.json
Tests/TestifySDKTests/Resources/Assets/json/ShellOutFailure.json
Tests/TestifySDKTests/Resources/Assets/tests/Kitura-coverage.tests
Tests/TestifySDKTests/Resources/Assets/tests/PromiseFailure.tests
Tests/TestifySDKTests/Resources/Assets/tests/ShellOutFailure.tests
Tests/TestifySDKTests/Resources/Assets/xml/Kitura.xml
Tests/TestifySDKTests/Resources/Assets/tests/Kitura.tests
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
SHELL=/bin/bash

baseUrl = https://raw.githubusercontent.com/BinaryBirds/github-workflows/refs/heads/main/scripts

test:
swift test --parallel

language:
curl -s $(baseUrl)/check-unacceptable-language.sh | bash

lint:
curl -s $(baseUrl)/run-swift-format.sh | bash

format:
curl -s $(baseUrl)/run-swift-format.sh | bash -s -- --fix

release:
swift package update && swift build -c release

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In your project folder run:
You can just use the [Swift Package Manager](https://theswiftdev.com/2017/11/09/swift-package-manager-tutorial/) as usual:

```swift
.package(url: "https://github.com/binarybirds/testify", from: "1.1.2"),
.package(url: "https://github.com/binarybirds/testify", from: "1.2.0"),
```

⚠️ Don't forget to add "Testify" to your target as a dependency!
Expand Down
Loading

0 comments on commit 614eef4

Please sign in to comment.