Closed michaeleustace closed 3 months ago
I got the same issue since today. Forcing 0.35.0
version working fine
Gotcha, sorry you're running into that issue. The only meaningful change in 0.36.0
was an update to Swiftlint itself in #200. @aiKrice does this issue look related?
(nudging works well !)
Can you put a piece of your dangerfile ?
I will try later in the day, (I use the binary_path with a localversion of swiftlint)
Hello @ashfurrow , I don't understand what's wrong but indeed locally it's break if I don't use the binary_path (so the local version of swiftlint downloaded by the tools). I double check the ash and the version and it looks good. Do you have an idea why it could fail (any hint?)
@aiKrice We are running Danger in GitLab runners.
Gemfile:
source "https://rubygems.org"
gem "bundler"
gem "danger"
gem "danger-gitlab"
gem "danger-swiftlint"
gem "gitlab-dangerfiles"
gem "danger-jira"
gem "git_diff_parser"
Dangerfile (only showing relevant part):
require "./danger/code_analysis.rb"
# Perform only when merging into develop
if gitlab.branch_for_merge.include? "develop"
CodeAnalysis.check_swiftlint(swiftlint, git)
end
and the CodeAnalysis file:
class CodeAnalysis
def self.check_swiftlint(swiftlint, git)
puts "Checking SwiftLint..."
swiftlint.config_file = '.swiftlint.yml'
swiftlint.lint_files(inline_mode: true) { |violation|
... does some stuff here
}
end
end
.gitlab-ci.ym stagel:
build_danger:
stage: build
before_script:
- bundle install --gemfile="danger/Gemfile"
script:
- danger
only:
- merge_requests
tags:
- macOS
The issue was solved. Can you double check please
@aiKrice Does it need a new version bump? - latest gem is still pointing to 0.36.0
Hello, we have the same error on Bitrise:
Running danger
$ bundle "exec" "danger" "--fail-on-errors=true"
bundler: failed to load command: danger (/Users/vagrant/.asdf/installs/ruby/3.2.4/bin/danger)
/Users/vagrant/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/danger-swiftlint-0.36.0/lib/danger_plugin.rb:68:in `lint_files': (Danger::DSLError)
[!] Invalid `Dangerfile` file: swiftlint is not installed
@ashfurrow . I think I can't push the new version of the gem. I already prepare a tag (i am not very familiar to rubygems deployment. I tried gem push command but unsuccessfully. I think my last commit is fine. Can you finish or tell me what to do ?
Last gem still pointing to 0.36.0. Please update rubygems: https://rubygems.org/gems/danger-swiftlint/versions and have it to 0.36.1
I can't :( Nudge @ashfurrow
Hey, sorry for the delayed response from me here.
First and foremost, thank you to @thomasjoulin for opening the PR that fixed this and to @aiKrice for reviewing the PR and tagging a new release.
I'm still the only owner on rubygems.org which is why the tag alone didn't work. I have pushed up the 0.36.1
version so this should work now.
If anyone runs into this kind of problem again, you can specify a last-known good version in your Gemfile
:
gem 'danger-swiftlint', '0.35.0'
This locks bundler
to using the old version, but of course you'd also have the old version of SwiftLint, too. Not my intention to assign blame here – I should have responded sooner – I only want to share a potential workaround.
Let's keep this issue open until someone can confirm it's fixed for them.
@ashfurrow I am using 0.36.1 now and it works successfully, thanks.
@michaeleustace wonderful, I’m glad to hear it’s working! Sorry again for the delay on my side.