Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Lint output #15

Merged
merged 10 commits into from
Feb 12, 2017
Merged

Lint output #15

merged 10 commits into from
Feb 12, 2017

Conversation

djbe
Copy link
Member

@djbe djbe commented Jan 30, 2017

Fixes #16

@AliSoftware AliSoftware self-assigned this Feb 12, 2017
Copy link
Collaborator

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall OK, but would be worth addressing the SwiftLint version change + simplify the shell script if possible.

Which would make you do a new commit… forcing Travis to unstuck itself, hopefully ^^

set -e

SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.9.1/SwiftLint.pkg"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're at SwiftLint 0.14 now. instead of having to update the number every time a new version of SwiftLint is released I think GitHub exposes an URL for the latest release, maybe we can use that

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I think I borrowed that script from SwiftLint or SourceKitten or somewhere like this, so maybe:

  • Worth mentioning the source somewhere
  • Worth checking if they have an updated version of this shell script

# Lint generated code in Tests/Expected
for f in `find "Tests/Expected" -name '*.swift'`
do
cat $f | swiftlint lint --use-stdin | sed s:'<nopath>':"$f":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember that I had to do this dance with stdin because swiftlint didn't accept files not ending in *.swift
So basically if I did swiftlint lint Tests/Expected/foo.swift.out then swiftlint would ignore the input file (because it didn't have a .swift extension), hence the cat + --use-stdin trick… + the replacement of <nopath> then.

Now that the files in Tests/Expected have been renamed to *.swift we should be able to directly use swiftlint lint $f I think. Or maybe even use find "Tests/Expected" -name '*.swift' -0 | xcargs -0 swiftlint lint?

@AliSoftware
Copy link
Collaborator

Seems there are 9 SwiftLint violations (line_length) in the test code itself, could be worth fixing before we merge this.

@AliSoftware AliSoftware merged commit 28be61a into master Feb 12, 2017
@djbe djbe deleted the feature/lint-output branch February 12, 2017 23:01
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants