Closed
Description
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.
Activity
lsegal commentedon 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 inyard doc
and using it in another command should be undefined behavior. The fix here should be to remove the option from documentation inyard stats --help
, however the commands above are expected behavior (though the latter command should warn about the unrecognized option).lsegal commentedon Sep 5, 2021
Actually given the simplicity of allowing
yard stats
to respect warning failure, it's probably easier to add it there.Support fail_on_warning in YARD::CLI::Stats