Conversation
I would love for this to go in with 100% coverage for formulas in master. @adzenith Can you add these two to the fork, please?
|
Updated, ran the script again, and committed. So unless anyone adds more formulae while we chat, we're good to go. Thanks! |
I am greatly in favor this pull request! This is the first big step to including |
@pthariensflame: We've been discussing just folding |
@adzenith No, I think the way it currently is in this PR is fine. :) |
👍 for this feature |
My two cents: Yes, that would be a good thing. It's been the default behavior of Here's what I'm imagining:
What do other people think of this? (I will likely begin to work up a version of this soon.) |
That sounds good to me. If I'm using |
Please don't commit changes to every formula at once, it will start a massive CI job that will always timeout. It needs to be done incrementally over time. |
@jacknagel The nature of this change is that it covers all formulas. (The change was originally put off partly because it wouldn't cover all the formulas.) Isn't it possible to adjust the CI job rather than force the PR to be split? If not, how many formulas at once is a reasonable guideline to change? Or alternatively since the changes to the formulas here can't break anything (I don't think), then couldn't it be pulled regardless of the CI failure? |
Or, alternatively, the CI job has already been cancelled. Are we ok with the commit staying in the PR? |
I don't think this is going to be feasible, unfortunately - a
|
There are several reasons that we don't make changes to every formula at once, CI Is only one of them. It will need to be rolled out in increments so that the brew update output doesn't show 3000 changed formulae, for example. I killed the CI job manually. Please don't push again without removing that commit first. |
A few questions:
If the answer to those are no, then there's not much sense moving forward. If the answers are yes, but with heavy changes to this PR, then that would be helpful to know. |
I'm personally very much in favour of finding a way to integrate descriptions to every formula. I think making it an option to |
As proposed in IRC, a solution may be to generate a cache in require "csv"
csv_cache = Formula.map {|f| CSV.generate_line [f.name, f.desc]}.join
File.open("#{HOMEBREW_CACHE}/desc.cache", "w") {|f| f.write csv_cache}
# ...
# and then in cmd/search
query = query_regexp(ARGV.next)
descriptions = CSV.parse File.read "#{HOMEBREW_CACHE}/desc.cache"
descriptions.each do |name, desc|
puts "#{name}: #{desc}" if desc =~ query
end This performs well:
|
To be clear, I haven't expressed any opinions about this proposal, I'm simply pointing out the reality of (a) our current CI situation and (b) how we roll out changes to a large number of formulae (in this case, all of them). It's hard to review 3000 formulae at a time, even if the change seems harmless. |
@jacknagel Fair enough. But I'd like to move forward. So if you have any opinions about the general idea, please share. (Also, if you have a rough estimate of how many formulas it would be best to change at once, let us know that too. ) |
Although I'm very much like To be clear, I'm in favor of such feature and integrate it into |
I strongly agree with @xu-cheng that the descriptions shouldn't go in the formulas. |
I think we should add descriptions to formulae and to the DSL.
I think the best thing to do in this PR would be to add the DSL and change a single formula that's quick to build (e.g. The problem we've had in these cases before which may need addressed before is that if we change every formula then they will all show up in |
I do think we should add support for storing additional metadata like this and having a search cache and I think it'll provide other benefits. I don't think adding a new single string DSL field to formulae needs this, though, and I'm happy to add this to search as So tl;dr:
|
@MikeMcQuaid Thanks for the plan. For the time being, I will continue to add new items (and remove deleted items) from Once all the descriptions are moved fully into formulas, I'll likely retire |
Thanks for all the comments! From what I've read (and what @MikeMcQuaid summarized), I will remove all of the descriptions except for If that all goes well, we can then look at what @mistydemeo was saying about caching descs, and potentially search descriptions by default. Sound good to everyone? I'll fix up the commits. |
Here are the new commits, only touching |
Let's make that only apply to |
return | ||
end | ||
|
||
#Make sure the formula name plus description is no longer than 80 characters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space between #
and M
Fixed the comment, and now |
@@ -1,4 +1,5 @@ | |||
class Ack < Formula | |||
desc "A search tool like grep, but optimized for programmers" | |||
homepage "http://beyondgrep.com/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor question here. Which style is better? Personally, I prefer homepage
is at the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The homepage is more canonical, so to speak, but the desc is more relevant (to me as someone who doesn't know what the formula is). That's why I put the desc first. Obviously it's easy to move second if that's preferred. I put it first in brew create
to match this, but can easily move it all below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My own personal strong preference is that we put the desc
as the last line of the initial block, i.e. under either the sha
or revision
. For some reason, having it as the top line is making me very uncomfortable, but I'm just weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to keep it above the sha and version, because the sha and version apply to a single version of the software, whereas the description deals with the software regardless of version (like the homepage). Is there a reason you'd want to have it down there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me at least, the initial formula block is in order of things I need to know most, that are most important to most people/formula authors.
I want to know where the formula is from first, I want to know where it's being download from next, and then I want to know what the checksum is for security. The formula description feels less important to me than any of those three things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I first was in favor of “homepage then desc then the rest” but I read @adzenith’s comment and now agree with the “description first, then homepage, then the rest”. The desc
is indeed the more relevant here, and the homepage’s URL doesn’t usually give you much information about the software (say the formula is “foobar”, the URL will likely be foobar.sourceforge.net
or some-academic-website.edu/~doe/software/foobar
) and you can open it quickly in your browser with brew home <formula>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My two cents: Let's please not let this PR get bogged down with bike-shedding. As far as I know, brew
does not enforce any rules about the order of items in the top of the class. So I can't see why we need to worry so very much about it. (My point being that once we start asking for opinions, everyone will have one, but really: is it that important?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, brew does not enforce any rules about the order of items in the top of the class.
This isn't quite true. It's not in the audit
but the only things that move around in the initial block unless there's need for stable do
is the version
line, if there is one. That can go either below the URL or below the sha
. But generally, although not audit-enforced, deviation from that tends to get asked to change. Whether that's just because formulae become a pain to update/compare/etc if all of them have different layouts or whether that's for another reason, I defer to the people who wrote the implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite true....
I didn't realize. Thanks for clarifying.
In that case, I suppose if we could get a quick ruling from the team, that would be great. I don't think it much matters where they pick, but I agree that having a convention is useful.
Again, my goal is to avoid protracted delay of the PR being merged because of bike-shedding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's hold off the ordering discussion for now and just leave it as-is.
Thanks for doing this, @adzenith. I'm glad this is finally happening. |
My pleasure! And hey, thanks for making |
Oh, and post a link here to that branch. Thanks! |
@MikeMcQuaid First, thanks you so much for your efforts to get this merged. I really appreciate it. Second, if you could, please ping me when you merge @adzenith's branch. That way, I can begin the process of phasing out Thanks again, @adzenith as well. |
@telemachus A pleasure. Still need to get |
@MikeMcQuaid Funny you say that since I've been noodling with it just now. |
@telemachus It should be relatively easy now to add a |
@MikeMcQuaid The last conversation I recall was that people wanted to avoid a new flag and switch on number of arguments. For example:
My school year is nearly over, so I'd be willing to put together a PR for either version, but do you think now that an explicit flag is better than checking the size of |
Yeh, I don't personally mind. It feels weird that we don't handle the two argument case? Maybe |
Now that I look again, I'm realizing that the super-explicit three argument form is a relic of when the tap structure was different. I think you're right and there's no longer any reason for three. I'll work on a PR early next week, I hope. Thanks. |
@MikeMcQuaid: check out this branch. Everything should be there! |
@adzenith Can you rebase your branch against homebrew/master and make sure there won't be duplicated desc field? Thanks. |
@xu-cheng Just to triple-check: if I merge that branch then |
@xu-cheng Right? |
They won't be sure. If you want to be absolute safe, you can split it to multiple commits as test, which can be helpful to code review as well. |
@adzenith Yeh, once it's rebased I'll get it merged in fairly quickly (and resolve any conflicts then myself). Thanks! |
@xu-cheng, @MikeMcQuaid: Just rebased again! And double-checked that there are no duplicate |
@adzenith Merged! |
Thanks for all your work on this, @telemachus and Nik (and Mike and Xu Cheng); this is great! 🎉 |
homebrew-desc is merged into homebrew itself: Homebrew/legacy-homebrew#39911
I come back to my computer after a week away, and not only is it merged but there's Tim! Hi Tim! Thanks @MikeMcQuaid, @xu-cheng, and especially @telemachus for doing all the hard work in the first place! |
• Add a desc field to the Formula class
• Fill out the desc field for each formula in Homebrew/homebrew
•
brew audit
checks for desc•
brew info
shows the desc•
brew search --desc
searches on desc (preliminary)