Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abitrolly
Copy link
Contributor

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Uses project language information from https://api.github.com/repos/Homebrew/brew if mode is not set explicitly.

@@ -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?
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abitrolly Any news here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants