Skip to content
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

yard stats --fail-on-warning doesn't fail on warnings #1392

Closed
ojab opened this issue Jul 26, 2021 · 2 comments
Closed

yard stats --fail-on-warning doesn't fail on warnings #1392

ojab opened this issue Jul 26, 2021 · 2 comments
Labels

Comments

@ojab
Copy link
Contributor

ojab commented Jul 26, 2021

Steps to reproduce

class Xxx
  # @param [xxx]
  def self.x
    puts 'xxx'
  end
end
$ yard doc --fail-on-warn .
[warn]: @param tag has unknown parameter name:  
    in file `xxx.rb' near line 3
…
$ echo $?
1
$ yard stats --fail-on-warn .
[warn]: @param tag has unknown parameter name:  
    in file `xxx.rb' near line 3
…
$ echo $?
0

Environment details:

  • OS: linux x64_64
  • Ruby version (ruby -v): ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
  • YARD version (yard -v): yard 0.9.26
  • Relevant software dependency/versions:
    • [Any 3rd party libs required to reproduce, omit if none]

I have read the Contributing Guide.

@lsegal
Copy link
Owner

lsegal commented Jul 26, 2021

This seems like a bug in documentation for yard stats --help. The --fail-on-warning option should not be listed as part of this command; due to internal structure of YARD CLI commands, these two commands share a common base, but not all options are shared.

In this case --fail-on-warning is defined strictly in yard doc and using it in another command should be undefined behavior. The fix here should be to remove the option from documentation in yard stats --help, however the commands above are expected behavior (though the latter command should warn about the unrecognized option).

@lsegal
Copy link
Owner

lsegal commented Sep 5, 2021

Actually given the simplicity of allowing yard stats to respect warning failure, it's probably easier to add it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants