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

Proposal: add desc stanza #77696

Closed
brandonkal opened this issue Feb 25, 2020 · 14 comments · Fixed by Homebrew/brew#8137
Closed

Proposal: add desc stanza #77696

brandonkal opened this issue Feb 25, 2020 · 14 comments · Fixed by Homebrew/brew#8137
Labels

Comments

@brandonkal
Copy link
Contributor

Description of feature/enhancement

Just like normal brew formulas have a description, casks should also accept a description.

This is not a request that all existing casks include a description, as that would require time. Rather, it is a request that The desc stanza will work as expected.

Would you accept a PR that adds this capability?

Justification

brew bundle dump can include descriptions in the generated Brewfile. This is quite useful when sharing a list of installed applications between multiple machines and people. Unfortunately, that only works for formula, which makes up 25% of my Brewfile. Adding descriptive comments manually is of course possible, but impractical.

@vitorgalvao vitorgalvao added the awaiting maintainer feedback Issue needs response from a maintainer. label Mar 1, 2020
@vitorgalvao
Copy link
Member

This has been discussed in the past. At the time we decided against it for being impractical, but today it seems feasible.

My suggestion to go through with it would be to add the desc stanza as an alias to name and slowly add it to casks. If it ever reaches sufficient adoption, we get rid of name; if it doesn’t, we get rid of desc. search already considers the contents of name anyway—though we may which to only make that work behind a flag, like the formulae search works—so it’s great as a drop-in replacement.

Pinging @Homebrew/cask.

@reitermarkus
Copy link
Member

I'm on board with that. I think a description is much more useful than a name, given that the name in most cases is only a capitalised token with spaces included.

@ran-dall
Copy link
Contributor

ran-dall commented Mar 1, 2020

LGTM

@vitorgalvao vitorgalvao removed the awaiting maintainer feedback Issue needs response from a maintainer. label Mar 22, 2020
@vitorgalvao
Copy link
Member

Seems like there’s no opposition to the idea. Are you still interested in working on a PR for this, @brandonkal? Let’s start slow.

@vitorgalvao vitorgalvao added the awaiting user reply Issue needs response from a user. label Mar 22, 2020
@brandonkal
Copy link
Contributor Author

I don't have the cycles to work on this right now or much familiarity with ruby outside of writing vagrant scripts and formula so it is probably best someone else takes this on.

If there is something I could do in a few months when I have time available I'd be open to it.

@no-response no-response bot removed the awaiting user reply Issue needs response from a user. label Mar 22, 2020
@vitorgalvao
Copy link
Member

I don't have (…) much familiarity with ruby

I thought you could do it, considering you said above:

Would you accept a PR that adds this capability?

In that case, I doubt this will happen any time soon, as it’s incredibly low priority.

@waldyrious
Copy link
Contributor

@vitorgalvao I'd like to work on this, but I'm confused by your earlier comment above — why should desc eventually replace name (if it gets sufficient adoption)? I would expect both to be present, providing different content. For example, for the fontforge.rb cask, I'd expect the new contents would become something like this:

   name 'FontForge'
+  desc 'Font editor and converter for outline and bitmap fonts'
   homepage 'https://fontforge.github.io/en-US/'

Was your point that the cask title/filename duplicates the name stanza? That indeed seems to be mostly the case for simple names, but fails for casks with spaces or even punctuation (e.g. "0-ad" vs "0 A.D."). Or am I missing something?

@vitorgalvao
Copy link
Member

@waldyrious You make some good points. Let’s get desc done first and decide later if name remains or goes, it’s not something we need to decide now.

@waldyrious
Copy link
Contributor

Great! Can you point me towards where I should start the work to implement this?

@vitorgalvao
Copy link
Member

Great! Can you point me towards where I should start the work to implement this?

Ping @reitermarkus.

@reitermarkus
Copy link
Member

@waldyrious
Copy link
Contributor

waldyrious commented Apr 12, 2020

@reitermarkus thanks for the pointer, but I'm afraid I'll need a bit more context. Can you outline, in broad strokes, the changes that would need to be done? I suspect even a barebones implementation will not merely a matter of adding a similar block in that file, just replacing name with desc.

I suppose I also need to (at least):

The tests would also need to be updated:

One would also need to update the documentation in this repo:

...and likely other changes that I'm missing in this list. I'd appreciate any guidance regarding the changes that need to be done. (Feel free to edit this comment to add, edit or remove items from the list in case it is useful as a starting point.)

@reitermarkus
Copy link
Member

@waldyrious, for the stanza order, the stanza will also have to be added to the RuboCop rule.

Other than that I think you have pretty much everything covered.

@waldyrious
Copy link
Contributor

waldyrious commented Jul 29, 2020

@waldyrious, for the stanza order, the stanza will also have to be added to the RuboCop rule.

@reitermarkus it seems to me that the correct order is already derived automatically, according to

https://github.com/Homebrew/brew/blob/2b33f995f371d0a4dc534c8f800954e6a8425b28/Library/Homebrew/rubocops/cask/stanza_order.rb#L24

and

https://github.com/Homebrew/brew/blob/2b33f995f371d0a4dc534c8f800954e6a8425b28/Library/Homebrew/rubocops/cask/ast/cask_block.rb#L29-L39

So as far as I can tell, it looks like we don't need to change anything for the order (and grouping) of the new stanza to be tested. Am I perhaps missing something?

@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants