0

When updating SwiftLint 0.16.1 to SwiftLint 0.18.1, I get:

/Users/coeur/Library/Developer/Xcode/DerivedData/MyApp-7-eloayqptodupvfhbyegtkncnhcpu/Build/Intermediates/MyApp-7.build/UAT-iphonesimulator/MyApp-7-Debug.build/Script-379156A71D62F5C100574D04.sh: line 2: 30296 Illegal instruction: 4 "${PODS_ROOT}/SwiftLint/swiftlint" Command /bin/sh failed with exit code 132

DerivedData is clean.
Using Xcode 8.3.1, CocoaPods 1.2.1, Swift 3.1.

My .swiftlint.yml:

# Find all the available rules by running:
# swiftlint rules

excluded:
- Carthage
- Pods

disabled_rules:
  - todo
  - line_length

opt_in_rules:
  - empty_count

trailing_whitespace:
 ignores_empty_lines: true
 ignores_comments: true
large_tuple: warning: 3
type_name: max_length: warning: 42
variable_name: min_length: warning: 1
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • @Makyen Thank you for the script. Judging if a question is close-worthy or delete worthy often requires more time than I can afford. I still flag and vote when I can evaluate it with no doubt. Currently, 1,954 votes cast and 163 post flags. Note that I made [this query](https://data.stackexchange.com/stackoverflow/query/653093) not too long ago, and once I finish fixing a few title typo, I'll tacle the hundreds of duplicates. Just, I'm acting at the level of my abilities, so forgive me for not closing/downvoting everything right away. – Cœur Aug 01 '17 at 01:42
  • @Makyen can you add a link to the script on your own profile? – Cœur Aug 01 '17 at 02:08
  • Yes, but I'd have to create a profile, which I've generally avoided, but should do so. Let me think about what I want to have there (other than that). Here's the link again if you need it: [Roomba Forecaster](http://stackapps.com/questions/7239/roomba-forecaster-when-will-the-question-be-roombaed-if-it-wont-why). It's also indirectly available as the only question I've posted on [stackapps.se], which can be gotten to (indirectly) through my network profile. – Makyen Aug 01 '17 at 02:21

1 Answers1

0

SwiftLint 0.18.x introduce a breaking change. They replace YamlSwift with Yams. Yams interprets YAML more strictly than YamlSwift, so if your .swiftlint.yml configurations previously worked with SwiftLint but didn't fully conform to the YAML 1.2 standard, you'll need to fix those validation errors.

In your (my) case, each mapping entry (denoted with a colon :) needs to be on its own line:

large_tuple:
 warning: 3
type_name:
 max_length:
  warning: 42
variable_name:
 min_length:
  warning: 1

Note that a pull request was made to avoid crashing SwiftLint with this issue in the future: https://github.com/jpsim/Yams/pull/37

Cœur
  • 37,241
  • 25
  • 195
  • 267