-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Fix brew style path checking #17482
Fix brew style path checking #17482
Conversation
It's late over here but I'll create PRs in the morning for the other tap style fixes (so this can pass CI). |
f815e34
to
1fa25b2
Compare
Still working on some additional fixes here! Sorry to hijack your PR @samford 😅 |
No worries, I'm only interested in having the bugs fixed and I'm not married to any particular implementation. You were working on this before, so I'm sure you know more about what's intended here 👍 I was about to push a fix for the |
@samford hold off, thanks, I have a more comprehensive fix I'm working on locally 👍🏻 |
101fcb6
to
95b1679
Compare
Now that |
Ah, I think the documentation CI will unfortunately inevitably be failing until this code reaches |
I opened a PR for the shellcheck issues in homebrew/services'
|
Seems like a false positive unfortunately (rhysd/actionlint#77). We already ignore it in Homebrew/actions: https://github.com/Homebrew/actions/blob/20fa46653804ab48a53e4b54e365b35bca71ccf4/.github/workflows/actionlint.yml#L42-L45 |
Thanks for confirming. I came across that issue when I was searching but I wasn't sure if it applied to our situation as well. For what it's worth, the
At this point, I've created PRs for all the issues I've seen while running |
Thanks @samford! |
32ecafc
to
24483bb
Compare
`brew style` tap support was broken in 7d0ac4d (Homebrew#17357), so now something like `brew style homebrew/core` exits without checking anything. This happens because the new file-handling logic doesn't do anything with a tap path. Previously, a tap path would be added to `ruby_files` but now it isn't added to any of the arrays of files to check. This fixes the issue by adding some logic to add the path to the `ruby_files` array if it's a tap.
Add all necessary files to the path, using globs when necessary.
24483bb
to
67dcd4a
Compare
67dcd4a
to
ca2ac3d
Compare
Thanks @samford! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew style
tap support was broken in #17357, so now something likebrew style homebrew/core
exits without checking anything. This happens because the new file-handling logic doesn't do anything with a tap path. Previously, a tap path would be added toruby_files
but now it isn't added to any of the arrays of files to check.This fixes the issue by adding some logic to add the path to the
ruby_files
array if it's a tap. [That's the general idea but feel free to suggest an alternative approach if there's a better way to address this.]While working on a fix, I was wondering if we had a way to check whether a path is a tap (e.g.,
path.tap?
) but I didn't see anything from a quick search (though I may have missed something). This also adds a#tap?
method toextend/pathname.rb
, so we can reuse this logic.If it's unlikely that we will ever use this again/elsewhere, I can just inline this code where it's used.