14 Commits

Author SHA1 Message Date
Eric Knibbe
cd6777fc73
audits: quote and reword problem description text 2025-05-30 23:49:26 -04:00
Issy Long
cb8769c2a0
rubocops/text: Allow bin interpolation inside word arrays
- We discovered that the following syntax in the formula `sqlsmith`
  should actually be OK because the `\n` is like whitespace.

```ruby
cmd = %W[
  #{bin}/sqlsmith
  --threads=4
  --timeout=10
]
shell_output(cmd)
```
2024-08-04 23:45:34 +01:00
Issy Long
7bf7030db8
Add autocorrection for the interpolated bin audit
- I got bored doing them manually.
- Also now more people can help with letters of the alphabet using `brew style --only=FormulaAuditStrict/Text --fix homebrew/core`.
2024-08-01 22:41:04 +01:00
Issy Long
f0084e611a
rubocops/text: Allow all "#{bin}/foo" interpolated strings with spaces
- This was complaining about `shell_output("#{bin}/abricate-get_db --help 2>&1")` which it shouldn't have.
2024-07-28 17:18:35 +01:00
Issy Long
38bb463aad
Interpolated shell_output("#{bin}/foo -v"), for example, is fine
- This would be weird to change because it's a string not a pathname passed to `shell_output`.
- I had misunderstood https://github.com/Homebrew/brew/pull/17826#discussion_r1690806375.
2024-07-25 13:28:00 +01:00
Issy Long
a6596c969f
Test the shell_output single string edge case 2024-07-25 10:41:13 +01:00
Issy Long
3713939e0d
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.
```
2024-07-24 22:19:38 +01:00
Issy Long
96400e01e1
rubocops/text: Enforce bin/"formula" instead of "#{bin}/formula" 2024-07-23 12:43:15 +01:00
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00:00
Patrick Linnane
c56669e9cd
various: fix miscellaneous typos 2023-07-18 08:52:49 -07:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Issy Long
da734a30c2
Say yes to RuboCop's DisplayCopNames; fix test expectations
- Fixing the test expected output was unbelievably tedious.
- There's been debate about this setting being `false` but in
  https://github.com/Homebrew/brew/pull/15136#issuecomment-1500063225
  we decided that it was worth using the default since RuboCop behaviour changed
  so we'd have had to do some horrible things to keep it as `false` -
  https://github.com/Homebrew/brew/pull/15136#issuecomment-1500037278 -
  and multiple maintainers specify the `--display-cop-names` option to
  `brew style` themselves since it's clearer what's gone wrong.
2023-04-07 19:14:07 +01:00
Rylan Polster
d5d7b6c3db
style: remove RSpec/MultipleDescribes violations
Co-authored-by: Nanda H Krishna <nanda.harishankar@gmail.com>
2021-02-01 20:30:51 -05:00