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

Parse Formula/Cask Descriptions From Source Code #32

Closed
apainintheneck opened this issue Nov 17, 2023 · 1 comment
Closed

Parse Formula/Cask Descriptions From Source Code #32

apainintheneck opened this issue Nov 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@apainintheneck
Copy link
Owner

Currently there are issues in core that are related to evaluating the package files for formulas and casks en masse. The problem here is that since they are really just Ruby files with limited to no sandboxing they can potentially run untrusted code and compromise your system.

For that reason there is the whole extra level of complexity with commands like brew desc when it comes to evaluating all package files. I wonder how simple it would be to just parse that info from the package files themselves using either the ripper or parser libraries. This is a potential workaround for the problem that could allow us to get the desired information without the same security concerns.

@apainintheneck
Copy link
Owner Author

apainintheneck commented Nov 19, 2023

The easiest thing to do here would be to just grep for the values since some parts of the package DSLs are so simple. For example, name and desc fall into that category. Beyond that, we could also try using ripper as mentioned above but it will have diminishing returns.

git grep --no-index -E '  (desc|name) "' -- '*.rb'

The commands that currently take --eval-all are:

  • cmd
    • deps
    • desc
    • info
    • options
    • readall
    • search
    • tap
    • uses
  • dev-cmd
    • audit
    • determine-test-runners
    • livecheck
    • unbottled

@apainintheneck apainintheneck added the enhancement New feature or request label Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant