Skip to content

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

Closed
@ojab

Description

@ojab
Contributor

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

lsegal commented on Jul 26, 2021

@lsegal
Owner

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

lsegal commented on Sep 5, 2021

@lsegal
Owner

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

added a commit that references this issue on Jan 25, 2024
8364574
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lsegal@ojab

        Issue actions

          `yard stats --fail-on-warning` doesn't fail on warnings · Issue #1392 · lsegal/yard