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

audit: complain about uppercase formula names #11447

Merged
merged 2 commits into from
May 31, 2021

Conversation

scpeters
Copy link
Member

  • 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?

As recently discussed in #11440 (comment), our docs state that "Filenames should be all lowercase". This adds an audit to complain about formula names with uppercase letters and a test.

scpeters added 2 commits May 27, 2021 17:45
Our docs state that formula filenames must not have uppercase letters.
This adds a test to expect that FormulaAuditor's audit_formula_name
method complains about such a formula.
Check for uppercase formula names in audit_formula_name method
of formula_auditor.
@BrewTestBot
Copy link
Member

Review period will end on 2021-05-31 at 01:00:34 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label May 28, 2021
Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

I agree this audit makes sense, but I can't help but wonder whether the issue is really in Formulary's handling of this. I wonder if it should either downcase before initializing the formula or Formula#new should downcase the name before assigning.

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label May 31, 2021
@BrewTestBot
Copy link
Member

Review period ended.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense to me! I agree with @Rylan12's comment but this PR is good to go as-is, I think.

# TODO: consider changing the actual versions here and make an audit to
# avoid these weird characters being used
version_rebuild.gsub(/[+#~]/, ".")

This may be interesting to you, too. Would love a PR that also audits versions to match the format we want (so we don't have to hack around it like this).

@MikeMcQuaid MikeMcQuaid merged commit 8171fd6 into Homebrew:master May 31, 2021
@scpeters scpeters deleted the lowercase_formula_names branch June 2, 2021 00:45
@github-actions github-actions bot added the outdated PR was locked due to age label Jul 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants