Skip to content

Commit 3b85709

Browse files
authored
Fix swiftlint integration (#111)
* Remove all code and integration of CodeBeat * Remove all code and integration of CodeClimate * Remove the crappy ugly shitty code and replace it with something one can actually read * Adds lots of comment and documentation for further maintenance * Parse the config files and insert properly the rule declarations * Fix integration for Frameworks
1 parent 9bf834d commit 3b85709

12 files changed

Lines changed: 241 additions & 347 deletions

CodeClimate/codeclimate.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

CodeClimate/copy-codeclimate-config.sh

Lines changed: 0 additions & 85 deletions
This file was deleted.

Codebeat/codebeatignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

Codebeat/codebeatsettings

Lines changed: 0 additions & 11 deletions
This file was deleted.

Codebeat/copy-codebeat-config.sh

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Helpers which can be added manually to the Xcode project which should be used:
1515
Scripts which should be called during the build phase:
1616

1717
- [SwiftLint](#swiftlint)
18-
- [Codebeat](#codebeat)
1918
- [Xcode version check](#xcode-version-check)
2019

2120
### Setup
@@ -25,27 +24,27 @@ Go to the the projects `Build Phases` configuration, add a `New Run Script Phase
2524
The script for an app should look like:
2625

2726
```
28-
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --buildconfig "${CONFIGURATION}" --targettype "${PRODUCT_TYPE}"
27+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "${PRODUCT_TYPE}"
2928
```
3029

3130
If the App uses SwiftUI, this call should be used:
3231

3332
```
34-
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --buildconfig "${CONFIGURATION}" --targettype "${PRODUCT_TYPE}" --SwiftUI
33+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "${PRODUCT_TYPE}" --SwiftUI
3534
```
3635

3736
If you're developing on a framework use this line on the all of your Unit Test targets:
3837

3938
```
40-
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --buildconfig "${CONFIGURATION}" --targettype "com.apple.product-type.framework"
39+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "com.apple.product-type.framework"
4140
```
4241

4342
This will copy the Codebeat configuration files, copy the SwiftLint configuration and for DEBUG configuration run SwiftLint. In case either of them shouldn't be used in the project a flag can be used to opt out (see the readme below).
4443

4544
If you want to add more parameters, eg. to disable SwiftLint, you have to add them with separate `"`s. Otherwise the parameters will be interpreted as one string. Example with disabled SwiftLint:
4645

4746
```
48-
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --buildconfig "${CONFIGURATION}" --targettype "${PRODUCT_TYPE}" "--no-swiftlint"
47+
"${SRCROOT}/Submodules/SMF-iOS-CommonProjectSetupFiles/setup-common-project-files.sh" --targettype "${PRODUCT_TYPE}" "--no-swiftlint"
4948
```
5049

5150
# Documentation
@@ -163,7 +162,7 @@ Multiple `#if canImport(LifetimeTracker)` checks make sure that targets with Lif
163162

164163
## Scripts to be called during Build phase
165164

166-
###SwiftLint
165+
### SwiftLint
167166

168167
Swiftlint is integrated in SMF-iOS-CommonProjectSetupFiles itself. The current version is 0.28.1.
169168

@@ -187,15 +186,6 @@ excluded:
187186
#### Optional: Call the SwiftLint script without using the setup script
188187
If you want to copy the SwiftLint configuration and lint the code without integrating the setup script you can call `Submodules/SMF-iOS-CommonProjectSetupFiles/SwiftLint/copy-and-run-swiftlint-config.sh` directly.
189188

190-
### Codebeat
191-
192-
[Codebeat](http://codebeat.co) is a service which provides static code analysis. The integration isn't done in the repo itself. But ignore and configuration files should be added to customize rules and ignore unwanted code (like generated source files).
193-
194-
The Codebeat configuration files copying is integrated in the [setup script](#setup). If it shouldn't be used you can pass the flag `--no-codebeat`.
195-
196-
#### Optional: Call the Codebeat configuration script without using the setup script
197-
If you want to copy the Codebeat configuration files without integrating the setup script you can call `Submodules/SMF-iOS-CommonProjectSetupFiles/Codebeat/copy-codebeat-config.sh` directly.
198-
199189
### Xcode version check
200190

201191
Building a project will trigger a Xcode version check to ensure you are working with the right Xcode version and an updated `smf.properties`. This script will look for the Xcode version specified in `smf.properties`. It will compare it to the Xcode version you are currently building the project and throw an error if it does not match.

0 commit comments

Comments
 (0)