-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
create: detect mode from GitHub project language #20031
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
base: master
Are you sure you want to change the base?
Conversation
@@ -98,6 +98,7 @@ def write_formula! | |||
@desc = @github["description"] | |||
@homepage = @github["homepage"].presence || "https://github.com/#{@github["full_name"]}" | |||
@license = @github["license"]["spdx_id"] if @github["license"] | |||
@mode = @github["language"].downcase.to_sym if @mode.nil? |
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.
How confident are you that this is "correct" for the majority of repositories? It may be worth running this on e.g. all homebrew/core GitHub repositories to see how often it matches up
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.
It is better than default C++ template, which is guaranteed to miss on all non C++ projects.
I am pretty sure I don't have enough quota to check all homebrew formulas, but here is the prompt that can be modified to spill out the code to run.
Hey Qwen. Can you check language (mode) of all Homebrew formulas that are hosted on GitHub and say how many of them match project["language"]
field that is returned form GitHub API?
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.
@MikeMcQuaid formulas don't expose any mode
or language
field, so how to match them?
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.
@abitrolly Same way you're doing here: use the GitHub repository from url
/head
and see if they see to at least partly match the expected create
output.
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.
@abitrolly Any news here?
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.
@MikeMcQuaid haven't figured out how to make the script to read formulas, exec create and partially match stuff. Maybe today.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Uses project language information from https://api.github.com/repos/Homebrew/brew if mode is not set explicitly.