344 Commits

Author SHA1 Message Date
Rylan Polster
d316819f0c
Add tests 2022-12-28 16:10:26 -05:00
Rylan Polster
a504d2c1aa
Check for loose Hardware::CPU method calls 2022-12-28 16:10:26 -05:00
Mike McQuaid
77c0d38c35
brew style --fix 2022-12-13 11:37:06 +00:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
apainintheneck
c7d53a2d9c Add cop to police os checks
The methods `OS.linux?` and `OS.mac?` should only be used
in `extend/os` and this cop makes sure of that.
2022-11-19 22:01:13 -08:00
Issy Long
6f2f97b98f
test/rubocops/formula_desc: Ensure autocorrect when desc ends in .
- This was another thing that I should have done in PR 3411 in 2017,
  tested that the regex for autocorrecting `desc` stanzas ending in full
  stops actually worked. At least I'm getting to it now.
2022-11-03 23:13:19 +00:00
Issy Long
f3d43110b5
test/rubocops/formula_desc: Ensure that desc allows ending with etc.
- This was funny (and embarrassing), I was looking at my first contributions to
  Homebrew since someone asked me how long I'd been involved.
- Turns out that in 2017 I improved the formula description RuboCop rule to
  allow descriptions to end with `etc.` in
  https://github.com/Homebrew/brew/pull/3411. Apparently I didn't have time
  back then to write a test for it. So now I will remedy this 5 years later.
2022-11-03 22:25:07 +00:00
Max Eisner
2946752083
extend tests 2022-09-06 14:42:03 +02:00
Max Eisner
7380f58173
extend tests 2022-09-06 14:42:03 +02:00
Max Eisner
3db65e7ee5
move tests to own specs file 2022-09-06 14:42:02 +02:00
Max Eisner
cf84800939
fix style 2022-09-06 14:42:01 +02:00
Max Eisner
4e286ee36d
fix test 2022-09-06 14:42:01 +02:00
Max Eisner
45d1c70559
add test 2022-09-06 14:42:01 +02:00
Rylan Polster
1c54e915b6
Update cask rubocops to use on_arch blocks and sha256 arm:, intel: 2022-08-25 00:49:28 -04:00
Rylan Polster
af99dfba00
Refactor on_system rubocops for use in casks 2022-08-14 17:31:07 -04:00
Rylan Polster
ad7e5ccc44
Add additional test 2022-08-11 19:14:21 -04:00
Rylan Polster
ec132ff851
Add and adjust cask rubocops to handle variables 2022-08-10 17:45:43 -04:00
fn ⌃ ⌥
b5a6f90cd8 Add tests 2022-08-03 06:33:30 -07:00
Rylan Polster
2c3926ae1e
Check nesting for blocks with one child 2022-07-24 23:37:36 +02:00
Rylan Polster
d5d6456b24
Add checks for on_system method 2022-07-24 23:01:56 +02:00
Rylan Polster
7b24ed3b4d
Update OnSystem cop to check other on_{system} methods 2022-07-24 23:01:56 +02:00
Rylan Polster
9b49561066
Update components_order cop to check other on_{system} methods 2022-07-01 10:52:41 -04:00
Mike McQuaid
22d6af1258
Manual brew style fixes. 2022-06-30 08:56:21 +01:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Bo Anderson
d0e4af8fb5
test/rubocops/patches: silence CodeQL alert 2022-05-20 01:44:05 +01:00
Carlo Cabrera
f05e57f414
Merge pull request #12823 from carlocab/setuptools-audit
rubocops/text: remove `setuptools` audit
2022-02-01 16:57:57 +08:00
Carlo Cabrera
bc67c05528
rubocops/text: remove setuptools audit
This currently no longer applies, because we might sometimes need an
older `setuptools` than the one shipped with a Python formula.

This is needed for Homebrew/homebrew-core#93964.
2022-02-01 15:26:50 +08:00
Roland Crosby
d8df9c2ee9 Allow cargo build --lib
When building Rust packages that provide libraries but no executable
binaries, `cargo install` doesn't do anything; you need to use `cargo
build` and install any libraries manually. See e.g.
rust-lang/cargo#8294.

Unfortunately, Homebrew's Rubocop "use cargo install *std_cargo_args"
rule, as currently written, blocks all invocations of `cargo build`.
This commit changes that rule to exclude invocations of `cargo build`
that use the `--lib` argument (`--lib` specifies to Cargo that a
package's library targets should be built). This will enable library
packages to be built while retaining the "use cargo install
*std_cargo_args" message for the more common case when a Rust package
provides executable binaries.
2022-01-31 21:11:22 -05:00
Bevan Kay
d371547d5a
fix tests 2022-01-12 10:39:38 +11:00
Bevan Kay
6f62b0e029
add tests 2022-01-11 13:18:06 +11:00
Mike McQuaid
a6e4e195c1
rubocops/lines: recommend on_os/OS.os? based on context.
Recommend the use of `on_macos` and `on_linux` unless we're in
`def install`, `def post_install` or `test do` in which case recommend
`OS.mac?` and `OS.linux?` instead.
2021-09-08 13:18:07 +01:00
Mike McQuaid
227a96fd7f
rubocops/lines: remove OS.mac?/OS.linux? check.
This will be reimplemented in https://github.com/Homebrew/brew/pull/11955
but this allows us to merge the homebrew-core changes before that PR is
merged.

Closes https://github.com/Homebrew/brew/pull/11946
2021-09-02 13:50:23 +01:00
Nanda H Krishna
5ccfbcd1d2
Autocorrect style issues with brew style --fix 2021-07-08 12:36:39 +05:30
Mike McQuaid
321c165bd3
Merge pull request #11350 from Gcenx/audit-fix-xcode-build-check
audit: Remove SYMROOT
2021-05-13 13:50:40 +01:00
Dean M Greer
ceeb5ea9ec audit: Remove SYMROOT
SYMROOT is only a valid argument when -project is used.

xcodebuild has other uses than building Xcode projects.
2021-05-13 08:07:06 -04:00
Bo Anderson
e5285b5ed8
Add cop for IO.read usage 2021-05-12 13:07:24 +01:00
Bo Anderson
6e2f194e09
rubocops/shell_commands: add cop for shell metacharacters in exec 2021-05-10 16:30:00 +01:00
Rylan Polster
ae89577b26
style: re-enable GitLab patch URL check 2021-04-19 11:19:35 -04:00
Rylan Polster
b5dec5fdbd
style: temporarily disable GitLab patch URL check 2021-04-19 09:13:06 -04:00
Jonathan Chang
ef1e07b88b
rubocops/patches: GitLab patches should use .diff
Only `.diff` URLs return output comparable to the diffs from
`git diff --full-index`. While the extra metadata from `.patch` is
nice, the instability of the patch contents is undesirable.

Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-04-19 09:08:14 -04:00
Bo Anderson
9063945b3e
Promote shell commands audit to global cop 2021-03-17 20:45:41 +00:00
Mike McQuaid
61427d6682
Merge pull request #10770 from SeekingMeaning/unless_logical_operators
rubocops: use `Style/UnlessLogicalOperators`
2021-03-05 11:45:42 +00:00
nandahkrishna
d68452f232
rubocops/patches: autocorrect some offenses 2021-03-04 12:36:18 +05:30
Seeker
7e7274aaeb rubocops: use Style/UnlessLogicalOperators
Replaces `Style/UnlessMultipleConditions`
2021-03-03 01:39:11 -08:00
Issy Long
e143dfdad6
Merge pull request #10658 from issyl0/rubocop-enable-rspec-context-wording
rubocop: Enable RSpec/ContextWording cop & fix offenses
2021-02-23 00:14:02 +00:00
Issy Long
38a427bf0d
test/option_declaration_spec: Align test description with contents 2021-02-20 00:04:05 +00:00
Issy Long
f194b5e983
test/bottle_format_spec: Align test description with contents 2021-02-20 00:03:47 +00:00
Issy Long
e1ad07190e
rubocop: Fix RSpec/ContextWording offenses
- For some of these I changed `context` to `describe` as it fit better
  rather than contriving a "when", "with" or "without", or massively
  restructuring the tests.
2021-02-19 23:30:41 +00:00
Rylan Polster
5f57601fd8
style: re-enable bottle order cop 2021-02-04 17:18:20 -05:00
Carlo Cabrera
2de172e050
rubocops/bottle: disable bottle order check
This is causing CI failures at homebrew/core [1], so let's disable this
for now.

[1] 01b6830646
2021-02-04 11:18:09 +00:00