Add SwiftLint and sort out boilerplate warnings and errors

This commit is contained in:
Angelo Stavrow 2020-07-22 10:17:11 -04:00
parent e08be286b1
commit 2463cc13d8
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
4 changed files with 25 additions and 3 deletions

2
.swiftlint.yml Normal file
View File

@ -0,0 +1,2 @@
type_name:
allowed_symbols: ["_"] # Used in SwiftUI boilerplate naming

View File

@ -8,7 +8,8 @@ class Tests_iOS: XCTestCase {
// In UI tests it is usually best to stop immediately when a failure occurs. // In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false continueAfterFailure = false
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. // In UI tests its important to set the initial state - such as interface orientation - required for your tests
// before they run. The setUp method is a good place to do this.
} }
override func tearDownWithError() throws { override func tearDownWithError() throws {

View File

@ -8,7 +8,8 @@ class Tests_macOS: XCTestCase {
// In UI tests it is usually best to stop immediately when a failure occurs. // In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false continueAfterFailure = false
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. // In UI tests its important to set the initial state - such as interface orientation - required for your tests
// before they run. The setUp method is a good place to do this.
} }
override func tearDownWithError() throws { override func tearDownWithError() throws {

View File

@ -194,6 +194,7 @@
17DF328C24C87D3500BCE2E3 /* Sources */, 17DF328C24C87D3500BCE2E3 /* Sources */,
17DF328D24C87D3500BCE2E3 /* Frameworks */, 17DF328D24C87D3500BCE2E3 /* Frameworks */,
17DF328E24C87D3500BCE2E3 /* Resources */, 17DF328E24C87D3500BCE2E3 /* Resources */,
17DF32C524C87FDB00BCE2E3 /* ShellScript */,
); );
buildRules = ( buildRules = (
); );
@ -341,7 +342,24 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n"; shellScript = "# Run SwiftLint on builds\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
17DF32C524C87FDB00BCE2E3 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Run SwiftLint on builds\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */