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

Feature request: linting / annotation-friendly format for warnings #1374

Open
ianfixes opened this issue Mar 8, 2021 · 0 comments
Open

Feature request: linting / annotation-friendly format for warnings #1374

ianfixes opened this issue Mar 8, 2021 · 0 comments

Comments

@ianfixes
Copy link

ianfixes commented Mar 8, 2021

Yard warnings seem like a mature feature; there is an explicit --fail-on-warning option. These warnings are very helpful -- they draw attention to incorrectly-documented code.

With the advent of tools like "annotations" in GitHub or syntax highlighters in a variety of modern IDEs (i.e. the ability to provide helpful feedback attached to specific file & line numbers), I'd like to be able to receive warnings in a format explicitly intended to be machine-readable.

For example, consider the following lines from bundle exec yard on a dummy example:

[warn]: @param tag has unknown parameter name: my_bogus_parameter
    in file `lib/my_library/some_file.rb' near line 49

I'd like some command line option that would render the warnings to either the screen in this format (greppable as lines starting with [warn]:):

[warn]:lib/my_library/some_file.rb:49:@param tag has unknown parameter name: my_bogus_parameter

Or, the option to render the warnings into a specific file on disk, in JSON or colon-separated format:

lib/my_library/some_file.rb:49:@param tag has unknown parameter name: my_bogus_parameter
{
  "warnings": [
    {
      "file": "lib/my_library/some_file.rb",
      "line": 49,
      "message": "@param tag has unknown parameter name: my_bogus_parameter"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant