diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 0000000..c26e448 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,28 @@ +name: SwiftLint + +on: + pull_request: + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + - name: GitHub Action for SwiftLint with --strict + uses: norio-nomura/action-swiftlint@3.2.1 + with: + args: --strict + - name: GitHub Action for SwiftLint (Only files changed in the PR) + uses: norio-nomura/action-swiftlint@3.2.1 + env: + DIFF_BASE: ${{ github.base_ref }} + - name: GitHub Action for SwiftLint (Different working directory) + uses: norio-nomura/action-swiftlint@3.2.1 + env: + WORKING_DIRECTORY: Source diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..f33757f --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,24 @@ +disabled_rules: + - function_parameter_count + - file_length + - function_body_length + - identifier_name + - type_body_length + - todo + - line_length + - nesting + - cyclomatic_complexity + - type_name + - no_space_in_method_call + - redundant_optional_initialization + - blanket_disable_command +opt_in_rules: + - closure_spacing + - sorted_imports +excluded: + - Pods + - Carthage + - Tools + - Scripts + - fastlane + - generated