-
-
Notifications
You must be signed in to change notification settings - Fork 398
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 --fail-on-warning option #1093
Conversation
Fixed typo and pushed forcibly |
lib/yard/cli/yardoc.rb
Outdated
@@ -200,6 +200,9 @@ class Yardoc < YardoptsCommand | |||
# @since 0.7.0 | |||
attr_accessor :has_markup | |||
|
|||
# @return [Boolean] whether yard exits with error status code if an warning occurs |
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.
Typo: if an warning
=> if a warning
lib/yard/cli/yardoc.rb
Outdated
@@ -273,6 +277,8 @@ def run(*args) | |||
end | |||
end | |||
|
|||
exit 1 if fail_on_warning && log.warned |
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.
You can use abort
instead of exit 1
- the (slight) benefit abort
has is that the provided failing exit status code is something which works for the current platform.
lib/yard/cli/yardoc.rb
Outdated
@@ -555,6 +561,10 @@ def general_options(opts) | |||
opts.on('--exclude REGEXP', 'Ignores a file if it matches path match (regexp)') do |path| | |||
excluded << path | |||
end | |||
|
|||
opts.on('--fail-on-warning', 'Exit with error status code if an warning occurs') do |
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.
Typo an warning
=> a warning
lib/yard/logging.rb
Outdated
@@ -60,6 +61,13 @@ def debug(*args) | |||
super | |||
end | |||
|
|||
# Remember an warning occurs and writes a warning message. |
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.
Perhaps: Remembers when a warning
...
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 think this is a nice feature!
@olleolleolle Thanks for reviewing 👍 |
Any reason this hasn't been merged? If so is there anything I can do help it along? I'd like to have yard validation a part of our PR review checks |
@yoshiwaan Would this project serve your needs for that? https://github.com/zverok/yard-junk |
Description
Add
--fail-on-warning
option. See #935Completed Tasks
bundle exec rake
locally (if code is attached to PR).