Skip to content

Commit

Permalink
RUMM-1222 Patch linter configuration for swiftlint 0.42.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ncreated committed Mar 30, 2021
1 parent 991b20f commit b64c443
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ workflows:
description: |-
Runs swiftlint and license check for all source and test files.
steps:
- script:
title: Patch linter configuration for swiftlint 0.42.0
inputs:
- content: |-
#!/usr/bin/env bash
set -e
./tools/lint/patch_if_swiftlint_0.42.0.sh
- [email protected]:
title: Lint Sources/*
inputs:
Expand Down
17 changes: 17 additions & 0 deletions tools/lint/patch_if_swiftlint_0.42.0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Patches `sources.swiftlint.yml` and `tests.swiftlint.yml` configs for swiftlint `0.42.0`.
# We need to run this patch on Bitrise, as their brew-core mirror doesn't include swiftlint `0.43.1`
# on some agent versions (notably: `Agent version: 1.20.0` considers `0.42.0` as the latest version).
#
# REF: we could eventually switch to the official brew source, but this is discouraged in
# https://discuss.bitrise.io/t/how-to-change-brew-core-from-mirror-to-official/16033

# SWIFTLINT_VERSION=$(swiftlint version)
SWIFTLINT_VERSION="0.42.0"

if [ $SWIFTLINT_VERSION = "0.42.0" ]; then
# Replace "../../" with ""
sed -i '' 's/..\/..\///g' tools/lint/sources.swiftlint.yml
sed -i '' 's/..\/..\///g' tools/lint/tests.swiftlint.yml
fi

0 comments on commit b64c443

Please sign in to comment.