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

add formulae descriptions (if available) when dumping Brewfile #297

Closed
wants to merge 2 commits into from

Conversation

phallstrom
Copy link
Contributor

This patch makes it so that when one runs brew bundle dump it will
append the formulae's descriptions as comments to the generated
Brewfile.

Comments are padded to align with the longest "brew line."

For example:

...
tap "homebrew/bundle"
brew "libyaml"                       # YAML Parser
brew "consul", restart_service: true # Tool for service discovery, monitoring and configuration
brew "eot-utils"
brew "pick"                          # Utility to choose one option from a set of choices
...

This patch makes it so that when one runs `brew bundle dump` it will
append the formulae's descriptions as comments to the generated
Brewfile.

Comments are padded to align with the longest "brew line."

For example:

    ...
    tap "homebrew/bundle"
    brew "libyaml"                       # YAML Parser
    brew "consul", restart_service: true # Tool for service discovery, monitoring and configuration
    brew "eot-utils"
    brew "pick"                          # Utility to choose one option from a set of choices
    ...
@phallstrom
Copy link
Contributor Author

The specs are passing. Rubocop is annoyed. One I could agree with the other are line lengths due to the JSON test setup (one of those isn't even in my patch so maybe you don't care too much about that). Let me know if you want the others fixed up.

== /usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle/lib/bundle/brew_dumper.rb ==
C: 35:  7: Avoid multi-line chains of blocks.
== /usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle/spec/brew_dumper_spec.rb ==
C:  6:  1: Block has too many lines. [566/144]
C: 81:  3: Block has too many lines. [196/144]
C:252:  7: Redundant curly braces around a hash parameter.
== /usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle/spec/brew_installer_spec.rb ==
C:  5:  1: Block has too many lines. [242/144]

@MikeMcQuaid
Copy link
Member

@phallstrom Yeh, please fix them all up, thanks.

@phallstrom
Copy link
Contributor Author

@MikeMcQuaid I didn't look too closely at the rubocop errors, but the 'too many lines' ones are complaining about Rspecs' "describe do" block. Doesn't seem right to break those up merely to satisfy rubocop. But I also see you aren't excluding any of them with inline disabling of rubocop. Makes me think this rubocop thing is relatively new. Please advise...

@MikeMcQuaid
Copy link
Member

@phallstrom As I think about this more I think it should probably be an optional parameter to brew dump. What do you think?

@MikeMcQuaid
Copy link
Member

@phallstrom Any thoughts?

@phallstrom
Copy link
Contributor Author

Sorry @MikeMcQuaid, I was out of town. I'll admit to being new to using this tool, but kind of feel it should be the default. I'm basing that off the assumption that if you're already setup with it you're going to manage the file yourself. If you're not, you probably want to dump it to get started and if you're like me have a million things you can't remember what they are. Not sure I'd look to see if there was a flag for it. But you could certainly convince me that's the right way :)

@MikeMcQuaid
Copy link
Member

@phallstrom I think it's better to not change the format of everyone's Brewfile's and e.g. Gemfiles and similar do not have this behaviour.

@stale
Copy link

stale bot commented Dec 10, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Dec 10, 2017
@stale stale bot closed this Dec 17, 2017
@lock lock bot added the outdated label Jan 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants