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

Set DocumentationBaseURL and DocumentationExtension #252

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

Earlopain
Copy link
Contributor

This allows ruby-lsp to link to cop documentation for this extension (notice the blue link which wasn't present before).

image

It takes you to https://github.com/Shopify/rubocop-sorbet/blob/main/manual/cops_sorbet.md#sorbetstrictsigil

Documentation here is in markdown and rubocop didn't support that until recently, so only set this when it supports both options. Otherwise it would link to non-existant html docs.

Requires a rubocop release with rubocop/rubocop#13080, draft for now.

@Earlopain Earlopain marked this pull request as ready for review August 31, 2024 15:08
@Earlopain Earlopain requested a review from a team as a code owner August 31, 2024 15:08
@Earlopain
Copy link
Contributor Author

RuboCop made a release, so this is good to go

Copy link
Contributor

@amomchilov amomchilov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea! I just have one q about the way the version check is done, but I love this change in principle

lib/rubocop/sorbet/inject.rb Outdated Show resolved Hide resolved
@amomchilov amomchilov enabled auto-merge September 4, 2024 14:34
This allows `ruby-lsp` to link to cop documentation for this extension.

Documentation here is in markdown and rubocop didn't support that until
recently, so only set this when it supports both options.
Otherwise it would link to non-existant html docs.
auto-merge was automatically disabled September 4, 2024 15:08

Head branch was pushed to by a user without write access

@Earlopain
Copy link
Contributor Author

@amomchilov Let's continue this here. Automerge still seemed to be stuck, I rebased on latest main.

@amomchilov amomchilov merged commit 115d959 into Shopify:main Sep 4, 2024
6 checks passed
@Earlopain Earlopain deleted the documentation-url branch September 4, 2024 16:01
Earlopain added a commit to Earlopain/rubocop-sorbet that referenced this pull request Oct 21, 2024
```
Warning: Sorbet does not support DisabledByDefault parameter.

Supported parameters are:

  - DocumentationBaseURL
  - DocumentationExtension
```

This is true. Because of Shopify#252, the top-level Sorbet config key now can be present simply by loading the config, which causes
RuboCop to do some extra validating.

`DisabledByDefault` is already set for all cops at the top anyways.
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

Successfully merging this pull request may close these issues.

2 participants