-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rspec-github integration #353
Conversation
Codecov Report
@@ Coverage Diff @@
## main #353 +/- ##
==========================================
- Coverage 43.28% 42.49% -0.80%
==========================================
Files 11 10 -1
Lines 841 779 -62
==========================================
- Hits 364 331 -33
+ Misses 477 448 -29
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec| | |||
spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 1.1.0' | |||
spec.add_runtime_dependency 'puppet-lint', '~> 2.0' | |||
spec.add_runtime_dependency 'puppet-syntax', ['>= 2.0', '< 4'] | |||
spec.add_runtime_dependency 'rspec-github', '~> 2.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an alternative to making it a hard dependency, it can also be made a soft dependency:
RSpec.configure do |c|
if ENV['GITHUB_ACTIONS'] == 'true'
begin
c.formatter = 'RSpec::Github::Formatter'
rescue LoadError
# rspec-github not present
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really matter if it is a hard dep? As long as there is a flag to turn it off for other CI systems, I don't see the gem being pulled as much of a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it isn't a hard dep, that would mean that rspec-github
would have to be manually added to (literally) 100s of repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really matter if it is a hard dep? As long as there is a flag to turn it off for other CI systems, I don't see the gem being pulled as much of a problem.
Every additional gem is a potential problem. Just wanted to highlight it.
If it isn't a hard dep, that would mean that
rspec-github
would have to be manually added to (literally) 100s of repos.
That was also my consideration. This looked easier for the average case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a discussion with @binford2k yesterday. I think this is a sane and useful patch. I also think rspec-github should be added as hard dependency, not a soft one. The patch was tested at Vox pupuli and it's working fine.
@ekohl I love this. There are going to be a few more updates to the repo so this PR will need rebasing soon.. (unless you want to keep rebasing as we merge changes). |
@ekohl @bastelfreak The bulk of work has been merged to main now. Would it be possible for one of you to rebase this and resolve the conflict? Once that is sorted i'll get it merged & it will be in the next release. |
This adds rspec-github as a dependency and at runtime it is optionally configured. The detection is the same as for Rubocop.
af049ed
to
8eaa209
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting, thank you for this.
This adds rspec-github as a dependency and at runtime it is optionally configured. The detection is the same as for Rubocop.
In voxpupuli/puppet-example#22 I've showcased that this works: