Skip to content

Commit

Permalink
added Swiftlint
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Espinola committed May 27, 2024
1 parent 53f326f commit 0cbb53a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint

on:
pull_request:
push:
branches:
- main

jobs:
lint:
name: Run Swiftlint
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode 15
run: |
sudo xcode-select -switch /Applications/Xcode_15.3.app
- name: Lint
run: swiftlint
21 changes: 21 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
disabled_rules:
- file_length
- line_length
- function_body_length
- type_body_length
- trailing_comma
- opening_brace
- todo
identifier_name:
allowed_symbols: "_"
min_length: 1
nesting:
type_level:
warning: 3
error: 6
function_level:
warning: 5
error: 10
excluded:
- Example
- ExampleSwift
23 changes: 23 additions & 0 deletions attentive-ios-sdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
buildPhases = (
58332EBE292EC18800B1ECF3 /* Headers */,
58332EBF292EC18800B1ECF3 /* Sources */,
FBF3A9BD2C04D7AA004D8C8F /* Swiftlint */,
58332EC0292EC18800B1ECF3 /* Frameworks */,
58332EC1292EC18800B1ECF3 /* Resources */,
);
Expand Down Expand Up @@ -490,6 +491,28 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
FBF3A9BD2C04D7AA004D8C8F /* Swiftlint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Swiftlint;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]\nthen\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif command -v swiftlint >/dev/null 2>&1\nthen\n swiftlint\nelse\n echo \"warning: `swiftlint` command not found - See https://github.com/realm/SwiftLint#installation for installation instructions.\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
58332EBF292EC18800B1ECF3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down

0 comments on commit 0cbb53a

Please sign in to comment.