-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
cop.documentation_url
is nil for extension cops
#12884
Comments
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this issue
May 16, 2024
The current implementation is not very useful to consumers since it requires every extension to overwrite this method. No official extension currenty does that. The behaviour of `--show-docs-url` is almost what's required. It takes a config to construct this url. The url it provides falls back to the default RuboCop docs url which is undesirable in all cases I can think about. That behaviour has been removed.
8 tasks
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this issue
May 16, 2024
The current implementation is not very useful to consumers since it requires every extension to overwrite this method. No official extension currenty does that. The behaviour of `--show-docs-url` is almost what's required. It takes a config to construct this url. The url it provides falls back to the default RuboCop docs url which is undesirable in all cases I can think about. That behaviour has been removed.
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this issue
May 16, 2024
The current implementation is not very useful to consumers since it requires every extension to overwrite this method. No official extension currenty does that. The behaviour of `--show-docs-url` is almost what's required. It takes a config to construct this url. The url it provides falls back to the default RuboCop docs url which is undesirable in all cases I can think about. That behaviour has been removed.
bbatsov
pushed a commit
that referenced
this issue
May 20, 2024
The current implementation is not very useful to consumers since it requires every extension to overwrite this method. No official extension currenty does that. The behaviour of `--show-docs-url` is almost what's required. It takes a config to construct this url. The url it provides falls back to the default RuboCop docs url which is undesirable in all cases I can think about. That behaviour has been removed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
This one here:
rubocop/lib/rubocop/cop/base.rb
Lines 63 to 69 in 7f9595a
It only returns something for cops in this repository. The Ruby LSP makes use of this method to link to a cops documentation in code lenses:
The blue link takes me to https://docs.rubocop.org/rubocop/cops_style.html#stylestringliterals
Here is how it looks for rubocop-rails (and basically all other extension) cops:
The method has the following comment:
This hasn't happenend yet. I'd like to do so, however I don't really know how I would do that since the Documentation class is private.
Describe the solution you'd like
rubocop --show-docs-url Rails/Exit
prints the correct url, so I wanted to just copy how it does that over. However I don't know how the get to the config/config store in the context of that method without requiring users to pass it in themselves.The text was updated successfully, but these errors were encountered: