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

rubocop: Try out rubocop-md for linting the code in our docs #16518

Merged
merged 16 commits into from
Feb 2, 2024

Conversation

issyl0
Copy link
Member

@issyl0 issyl0 commented Jan 21, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

  • Maybe we can tidy up the code in our docs using this RuboCop extension to lint codeblocks in Markdown?

@issyl0
Copy link
Member Author

issyl0 commented Jan 21, 2024

cannot load such file -- rubocop-md Yes, I'm also getting this locally. But brew style on this branch initially runs install_bundler_gems, because of the Gemfile changes, and it does install the gem, so it should work? What am I missing? 🤔

@issyl0
Copy link
Member Author

issyl0 commented Jan 21, 2024

I figured it out! I was missing brew vendor-gems.

@apainintheneck
Copy link
Contributor

I'm kind of surprised that the number of offenses is so low.

@issyl0
Copy link
Member Author

issyl0 commented Jan 22, 2024

Oh, CI passing isn't representative, I've not got this working yet, but locally there are still 60-odd problems.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looking good so far, thanks @issyl0!

@issyl0 issyl0 force-pushed the rubocop-md branch 4 times, most recently from c759444 to 37fad74 Compare January 23, 2024 23:33
issyl0 added 10 commits January 24, 2024 00:01
- This could be useful for linting code in our docs.
- Blocks should open with `do` and close with `end`.
- `...` is not valid Ruby syntax, so comment it out so that the user
  knows that it's a placeholder for "other things here".
- Reword the "header line details" in `Cask-Cookbook` otherwise RuboCop
  crashes even with an `end` because of the empty block. There was
  already an example of a valid header line in the first code block on
  the page, so it's not a big loss.
- T::Sig hasn't been needed in every file for a long time.
- Yes, we have yet another `.rubocop.yml` but in-line exclusions in
  `<span class="display:none;">` in the Markdown seemed more ugly.
- This needed tweaks to `brew style` to make it read the new config
  file when we're scanning docs.
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looking great so far, thanks @issyl0!

docs/.rubocop.yml Outdated Show resolved Hide resolved
@issyl0 issyl0 marked this pull request as ready for review January 27, 2024 19:03
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks pretty good, a few nits, thanks @issyl0!

docs/Adding-Software-to-Homebrew.md Outdated Show resolved Hide resolved
docs/Formula-Cookbook.md Outdated Show resolved Hide resolved
docs/Formula-Cookbook.md Outdated Show resolved Hide resolved
docs/Node-for-Formula-Authors.md Outdated Show resolved Hide resolved
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good! One suggestion, non-blocking.

docs/Formula-Cookbook.md Outdated Show resolved Hide resolved
- We don't need this blanket enabled, we only have a few docs where it actually matters that there's a description, it's just cruft having to invent descriptions.
@issyl0 issyl0 enabled auto-merge February 2, 2024 15:40
@issyl0 issyl0 merged commit 06028c2 into Homebrew:master Feb 2, 2024
24 checks passed
@issyl0 issyl0 deleted the rubocop-md branch February 2, 2024 15:57
@github-actions github-actions bot added the outdated PR was locked due to age label Mar 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants