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

rubocops/text: Enforce bin/"formula" instead of "#{bin}/formula" #17826

Merged
merged 4 commits into from
Jul 25, 2024

Commits on Jul 23, 2024

  1. Configuration menu
    Copy the full SHA
    96400e0 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. rubocops/text: Include dashed binaries in bin/ interpolation check

    - Previously this only included the formula name.
    - But, for example in tests, we have "#{bin}/ansible-test",
      not just "#{bin}/ansible". So handle that too.
    - I decided to make the error message better by extracting the
      binary name from the interpolation, but I'm not sure it was worth it.
    
    ```
    $ brew audit --strict ansible
    ansible
      * line 580, col 29: Use `bin/"ansible-test"` instead of `"#{bin}/ansible-test"`
    Error: 1 problem in 1 formula detected.
    ```
    issyl0 committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    3713939 View commit details
    Browse the repository at this point in the history
  2. Make the bin starts_with method its own thing as it needs more args

    - I couldn't get
      https://docs.rubocop.org/rubocop-ast/node_pattern.html#param_name-for-named-parameters
      to work like it said it should (bad syntax in the node_matcher, apart
      from with `bin = false` which RuboCop complained about boolean args not
      being named), so here's a workaround.
    issyl0 committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    ace23ce View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Configuration menu
    Copy the full SHA
    a6596c9 View commit details
    Browse the repository at this point in the history