Closed rumnat closed 4 years ago
This looks like a Ruby issue.
gem 'danger-swiftformat'
to your Gemfile
?danger
using bundler: bundle exec danger
?Yes, here is my Gemfile:
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'danger'
gem 'danger-swiftlint'
gem 'danger-jira'
gem 'danger-swiftformat'
danger running command bundle exec danger --fail-on-errors=true
I also have .ruby-version file with 2.4.1 setting
/Users/buddybuild/.rubies/ruby-2.5.1/lib/ruby/2.5.0/open3.rb:199:in `spawn'
/Users/buddybuild/.rubies/ruby-2.5.1/lib/ruby/2.5.0/open3.rb:199:in `popen_run'
/Users/buddybuild/.rubies/ruby-2.5.1/lib/ruby/2.5.0/open3.rb:95:in `popen3'
/Users/buddybuild/.rubies/ruby-2.5.1/lib/ruby/2.5.0/open3.rb:258:in `capture3'
/Users/buddybuild/.gem/ruby/2.5.1/gems/danger-swiftformat-0.6.0/lib/swiftformat/cmd.rb:7:in `run'
/Users/buddybuild/.gem/ruby/2.5.1/gems/danger-swiftformat-0.6.0/lib/swiftformat/swiftformat.rb:10:in `installed?'
/Users/buddybuild/.gem/ruby/2.5.1/gems/danger-swiftformat-0.6.0/lib/swiftformat/plugin.rb:40:in `check_format'
something with an installed check
Are you still encountering this issue?
I gave up then and moved it to a run script phase for the tests target
Ah, I think I got it. It’s likely that the tool can’t find the swiftformat
binary, hence the error.
It’s a bit tool late now though. Sorry about that. I’ll close the issue.
Happy holidays.
I encounter this now :-(
@stherold how is swiftformat
installed in your project? This error is thrown when the script cannot find the swiftformat
binary.
Argh I, got it! I think we have a special case. I want to make it work using GitHub Actions and as a bonus the tooling uses the Ubuntu runner from GH Actions where no SwiftFormat is installed. Sadly I wasn't able to find any great workflow example that demonstrates the full integration as follows:
Did you encounter a working example in the past when creating the plugin?
@stherold I haven't used the plugin in years 😃
However, when I did, I always vendored the binary to make sure that the whole team was using the same one. Our CI used macOS machines, so they could use the vendored binary as well, which is probably not the case for you.
My recommendation would be to find out where the swiftformat
binary gets installed on your CI, then use that as the binary_path
.
Hi, I get the error
Danger file and swiftformat file are in the same folder