Skip to content

License style cleanup#8411

Merged
MikeMcQuaid merged 5 commits intoHomebrew:masterfrom
Rylan12:license-rubocop
Aug 21, 2020
Merged

License style cleanup#8411
MikeMcQuaid merged 5 commits intoHomebrew:masterfrom
Rylan12:license-rubocop

Conversation

@Rylan12
Copy link
Copy Markdown
Member

@Rylan12 Rylan12 commented Aug 20, 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?

This PR does a few things:

  1. License arrays are now converted to hashes in the license method rather than on-demand when needed by e.g. audit. This means that calling formula.license will always return either a string, symbol, or hash.
  2. Deprecate license arrays. This will display a deprecation message whenever license [...] is called. This message would show up when running brew audit, brew install, etc.
  3. brew style forbids using license arrays. brew style --fix will automatically correct license arrays to an :any_of hash.
  4. brew style requires using multiple lines for license expressions if there are nested hashed. This means that license any_of: ["MIT", "0BSD"] is allowed but license any_of: ["MIT", "0BSD" => { with: "LLVM-exception" }] is not.

Copy link
Copy Markdown
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.

Great work as usual @Rylan12!

Comment thread Library/Homebrew/formula.rb Outdated
@MikeMcQuaid MikeMcQuaid merged commit 79695b0 into Homebrew:master Aug 21, 2020
@Rylan12 Rylan12 deleted the license-rubocop branch August 21, 2020 14:21
@scpeters
Copy link
Copy Markdown
Contributor

If license arrays are no longer allowed, then I think bump-revision needs an update to revert 1ac470f from #8139, though I'm not sure if that will be sufficient to support symbols or hashes. I'll investigate further...

@Rylan12
Copy link
Copy Markdown
Member Author

Rylan12 commented Sep 12, 2020

@scpeters I've got a fix in #8708

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

4 participants