Skip to content

Add PR tests by Danger and SwiftLint - #1257

Merged
Kaspik merged 6 commits into
MessageKit:developmentfrom
classdojo:PR_danger_swiftlint
Feb 28, 2020
Merged

Kaspik merged 6 commits into
MessageKit:developmentfrom
classdojo:PR_danger_swiftlint

Conversation

@Kaspik

@Kaspik Kaspik commented Feb 26, 2020

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

Added Dangerfile, Gemfile for danger and Swiftlint

Does this close any currently open issues?

No.

@Kaspik
Kaspik changed the base branch from circleCIUpdates to development February 26, 2020 13:12
@Kaspik
Kaspik changed the base branch from development to circleCIUpdates February 26, 2020 13:12
@austinwright austinwright self-assigned this Feb 28, 2020
Comment thread Dangerfile
Comment thread Dangerfile
Comment thread Dangerfile Outdated
Comment thread Gemfile Outdated
@Kaspik
Kaspik changed the base branch from circleCIUpdates to development February 28, 2020 12:11
Comment thread Dangerfile Outdated
@Kaspik
Kaspik merged commit 5a33741 into MessageKit:development Feb 28, 2020
@Kaspik
Kaspik deleted the PR_danger_swiftlint branch February 28, 2020 12:27
Comment thread Dangerfile

swiftlint.config_file = '.swiftlint.yml'
swiftlint.lint_files inline_mode:true
swiftlint.lint_files fail_on_error:true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Kaspik - This second line causes swiftlint to run again, I think you have to aggregate the options onto one swiftlint.lint_files command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, if you look closer at the check phase, we're getting this error (twice):

/opt/hostedtoolcache/Ruby/2.6.5/x64/lib/ruby/gems/2.6.0/gems/danger-swiftlint-0.24.1/ext/swiftlint/bin/swiftlint: 1: /opt/hostedtoolcache/Ruby/2.6.5/x64/lib/ruby/gems/2.6.0/gems/danger-swiftlint-0.24.1/ext/swiftlint/bin/swiftlint: Syntax error: "(" unexpected
/opt/hostedtoolcache/Ruby/2.6.5/x64/lib/ruby/gems/2.6.0/gems/danger-swiftlint-0.24.1/ext/swiftlint/bin/swiftlint: 1: /opt/hostedtoolcache/Ruby/2.6.5/x64/lib/ruby/gems/2.6.0/gems/danger-swiftlint-0.24.1/ext/swiftlint/bin/swiftlint: Syntax error: "(" unexpected

I tried it on my own CI with verbose turned on and am getting this:

Using config file: .swiftlint.yml
Swiftlint will be run from /home/runner/work/<private-repo>/<private-repo>
Swiftlint will exclude the following paths: []
Swiftlint includes the following paths: []
linting with options: {:config=>".swiftlint.yml", :reporter=>"json", :quiet=>true, :pwd=>"/home/runner/work/<private-repo>/<private-repo>", :force_exclude=>true}
Swiftlint will lint the following files: /home/runner/work/<private-repo>/<private-repo>/<private-repo-folder>/TempDangerPoC.swift
/opt/hostedtoolcache/Ruby/2.6.5/x64/lib/ruby/gems/2.6.0/gems/danger-swiftlint-0.24.1/ext/swiftlint/bin/swiftlint: 1: /opt/hostedtoolcache/Ruby/2.6.5/x64/lib/ruby/gems/2.6.0/gems/danger-swiftlint-0.24.1/ext/swiftlint/bin/swiftlint: Syntax error: "(" unexpected
Received from Swiftlint: {}

So... not very helpful except that I noticed my included paths specified in my .swiftlint.yml are not being honored.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmmm, I don't think running it twice hurts, but I'll switch it to one-line command.

Yes, there is a bug in SwiftLint, but I didn't have time to look at it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants