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

style: require tag and revision for git urls #8848

Merged
merged 2 commits into from
Oct 4, 2020
Merged

style: require tag and revision for git urls #8848

merged 2 commits into from
Oct 4, 2020

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Oct 3, 2020

  • 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 tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

Require a revision for git urls in homebrew/core

Require a tag as well if --strict is passed.

For example, this is always 👍:

url "https://github.com/foo/bar.git",
    tag:      "v1.0.0",
    revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

This is 👍 unless --strict is passed and then 👎:

url "https://github.com/foo/bar.git",
    tag: "v1.0.0"

This is always 👎:

url "https://github.com/foo/bar.git"

Sorry, something went wrong.

@jonchang
Copy link
Contributor

jonchang commented Oct 3, 2020

My quick thoughts on this:

has revision and tag: OK
has revision only: strict audit in core, fine everywhere else
has tag only: forbidden in core, fine everywhere else (??)

(I point this out only because I have a bunch of formulae in my personal tap that have only a revision because upstream doesn't believe in version tagging)

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 3, 2020

Yeah, I think that makes sense. There are a small number in homebrew/core that fall into the category of "not believing in tagging" so that would allow those to stay.

In terms of tag only, I don't have a preference as to whether to require it everywhere or only in core. It probably makes sense to only do it in core, though, because we don't need to be making decisions about what formulae are allowed for non-official taps.

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 3, 2020

Okay, I've updated the conditions a little bit:

  • No requirements for non-core taps
  • git urls must have a revision
  • git urls must have a tag when passed with --strict

@jonchang
Copy link
Contributor

jonchang commented Oct 4, 2020

Nice work. Let's try it out.

@jonchang jonchang merged commit 6151907 into Homebrew:master Oct 4, 2020
@Rylan12 Rylan12 deleted the git-urls-require-tag-and-revision branch October 4, 2020 14:39
@MikeMcQuaid
Copy link
Member

Nice work @Rylan12!

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 3, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 3, 2020
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.

None yet

4 participants