330 Commits

Author SHA1 Message Date
apainintheneck
07ff122c8d Ignore os cop in tap Formula/Cask folders 2022-12-09 18:07:13 -08: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
1db5d967c3 Ignore os.rb where checks are defined 2022-11-23 20:39:59 -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
c4e6a46271
rubocop: Set inherit_mode for allowed Naming/MethodParameterName
- As I was looking through the RuboCop configs for
  `Naming/MethodParameterName`, since there was a fairly long-standing
  TODO here, I found that in the default RuboCop configs the method
  names `to` and `io` are
  [allowed by default](41a8249b35/config/default.yml (L2794)).
- But we weren't inheriting those allowed names correctly from the
  default configuration. This fixes that so that we get future
  enhancements automatically for this particular cop allowlist.
2022-10-30 21:49:40 +00:00
Issy Long
c53b14e955
rubocop: Remove _ from allowed Naming/MethodParameterName
- As of RuboCop v0.67.0 (quite some time ago!), this rule allows `_` by
  default as it commonly denotes "this argument is unused". This is not
  set upstream in `AllowedNames`, the code
  [ignores underscores](4bc7d8c1bc (diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed))
  entirely.
2022-10-30 21:48:17 +00:00
Mike McQuaid
e6323100bb
rubocop.yml: enable ActiveSupportExtensionsEnabled. 2022-06-30 08:56:21 +01:00
Bo Anderson
4d5378362c
.rubocop.yml: disable Style/FetchEnvVar in formulae (for now) 2022-06-17 19:47:57 +01:00
Bo Anderson
8500c26419
.rubocop.yml: fix obsolete parameter usage 2022-06-17 19:47:55 +01:00
Bo Anderson
547d3c9e0f
.rubocop.yml: enable some new cops from rubocop-rails 2.15.0 2022-06-16 22:01:07 +01:00
Issy Long
cec469c3d9
rubocop: Remove an allowlist entry for blacklist usage
- The usage in the `xmlsectool` formula went away in
  76618ad7fc.
- If I revert the changes in that commit and run
  `brew style --only="Naming/InclusiveLanguage" xmlsectool`, RuboCop reports an
  offense and suggests an alternative term.
2022-03-04 00:22:23 +00:00
Bo Anderson
a9d97ac805
.rubocop.yml: enable Rails/CompactBlank and DurationArithmetic 2021-12-27 20:45:26 +00:00
Bo Anderson
246d0868b6
.rubocop.yml: selectively enable Rails cops 2021-12-16 16:40:03 +00:00
Bo Anderson
b1b76ea59b
.rubocop.yml: override StrictSigil includes 2021-12-04 03:13:15 +00:00
Mike McQuaid
a2e2ea4b51
.rubocop.yml: allow OpenStruct. 2021-11-18 11:48:30 +00:00
Mike McQuaid
7e18e571f7
rubocop.yml: fix formula-analytics bug. 2021-09-30 12:30:45 +01:00
Mike McQuaid
7bade41572
rubocop.yml: fix #: usage.
Also, do some automatic reformating.
2021-08-16 13:58:13 +01:00
Issy Long
c52c694e12
rubocop: Remove atlantis formula whitelist flag from being allowed
- This was changed in 9f39d2e405..
2021-07-10 13:39:14 +01:00
Issy Long
6ce59fef8b
dev-cmd/typecheck: error-white-list renamed to isolate-error-code
- It was renamed in
  4ea6842988
  which is included in the ancient version we're using.
2021-07-10 00:30:08 +01:00
Nanda H Krishna
87e776fed6
Update configuration in Library/.rubocop.yml 2021-07-08 12:36:40 +05:30
Michael Cho
b44ecaceb7
docs: fix cask doc urls to use docs.brew.sh 2021-06-25 13:20:40 -07:00
Bo Anderson
e5285b5ed8
Add cop for IO.read usage 2021-05-12 13:07:24 +01:00
Seeker
7e7274aaeb rubocops: use Style/UnlessLogicalOperators
Replaces `Style/UnlessMultipleConditions`
2021-03-03 01:39:11 -08:00
Rylan Polster
3edf569f7e
style: require parentheses around regex arguments 2021-02-19 14:16:27 -05:00
Bo Anderson
323ff660fa rubocop: use consistent array/hash indentation 2021-02-11 13:27:42 +00:00
Rylan Polster
dee57c307d
style: allow long lines for bottle digests 2021-02-03 09:32:08 -05:00
Mike McQuaid
89fc131422
Gemfile: install bootsnap.
And allow type checking of `homebrew_bootsnap.rb`.
2021-02-02 12:34:15 +00:00
Mike McQuaid
a1c6d39792
rubocop.yml: autofix formatting. 2021-02-02 11:54:59 +00:00
Mike McQuaid
26755632a9
rubocop.yml: restore buggy 1.9.0 cops. 2021-02-02 10:17:11 +00:00
Mike McQuaid
50da5d6769
rubocop.yml: disable Rails/RakeEnvironment
Another rule that assumes Rails usage.
2021-02-01 10:56:18 +00:00
Mike McQuaid
27e8c117e4
rubocop.yml: disable some buggy cops. 2021-01-29 20:57:00 +00:00
Michka Popoff
46c5965037 style: handle line too long for new bottle blocks
The " was for a previous syntax we had, but we dropped that and changed our minds.
This PR fixes the style check for the current implementation of the new bottle blocks.
2021-01-28 20:02:29 +01:00
Michka Popoff
e142dd3fc1
rubocop: do not complain for too long sha256 lines in bottle blocks 2021-01-28 13:19:41 +00:00
Mike McQuaid
dad1939142
Fix HOMEBREW_BOOTSNAP setup
- rename to `homebrew_bootsnap.rb` to avoid conflicting with the
  `bootsnap.rb` we need to `require`
- if the `require` fails: run bundler (until we vendor this gem)
2021-01-21 17:35:13 +00:00
Mike McQuaid
683ae7ff53
Add HOMEBREW_BOOTSNAP to optionally use Bootsnap
> Bootsnap is a library that plugs into Ruby, with optional support
> for ActiveSupport and YAML, to optimize and cache expensive
> computations.
https://github.com/Shopify/bootsnap

For our case that translates to "repeated calls to `brew` have
reductions in the time spend `require`ing speeding up the process
boot time".

For example:

```
$ hyperfine --warmup=2 "unset HOMEBREW_BOOTSNAP; brew info wget" "export HOMEBREW_BOOTSNAP=1; brew info wget"
Benchmark #1: unset HOMEBREW_BOOTSNAP; brew info wget
  Time (mean ± σ):      2.417 s ±  0.032 s    [User: 659.0 ms, System: 855.5 ms]
  Range (min … max):    2.382 s …  2.464 s    10 runs

Benchmark #2: export HOMEBREW_BOOTSNAP=1; brew info wget
  Time (mean ± σ):      1.862 s ±  0.064 s    [User: 425.3 ms, System: 566.8 ms]
  Range (min … max):    1.736 s …  1.952 s    10 runs

Summary
  'export HOMEBREW_BOOTSNAP=1; brew info wget' ran
    1.30 ± 0.05 times faster than 'unset HOMEBREW_BOOTSNAP; brew info wget'
```
2021-01-21 12:34:04 +00:00
Dustin Rodrigues
59b8e27998 rubocop: disallow and/or in favor of &&/|| 2021-01-18 14:16:56 -05:00
Markus Reiter
b1000952b1 Make LazyObject type-checkable. 2021-01-13 10:46:28 +01:00
Mike McQuaid
7cc48a03d5
rubocop: exclude new cop.
This doesn't look good for DSLs.
2020-12-31 13:30:24 +00:00
Mike McQuaid
ec23ba0b36
rubocop.yml: require relevant gems.
This avoids RuboCop erroring out.
2020-12-31 13:30:24 +00:00
Mike McQuaid
292363cc40
rubocop: disable another invalid Rails cop. 2020-12-09 11:18:35 +00:00
Mike McQuaid
8528eff604
Add and enable rubocop-rails.
This will help us catch and cleanup usage of e.g. `.blank?` and other
helpers we use from ActiveSupport.
2020-12-02 10:43:04 +00:00
linzichao
058a1c3645 add verified parameter in url 2020-12-01 01:17:21 +01:00
Markus Reiter
64a0e9a721 Add type signatures for Caskroom. 2020-11-19 16:07:50 +01:00
Markus Reiter
47aded9dac
Merge pull request #9166 from reitermarkus/rubocop
Enable `Performance/ConstantRegexp` cop.
2020-11-18 04:16:38 +01:00
Daniel Bayley
cfceee7872 Fix brew style checks on Brewfiles
Fixes https://github.com/Homebrew/homebrew-test-bot/issues/522
2020-11-17 16:05:11 +00:00
Markus Reiter
71095f2147 Enable Performance/ConstantRegexp cop. 2020-11-17 15:18:37 +01:00
Markus Reiter
e8c0de0db4 Disable Performance/ConstantRegexp cop for now. 2020-11-17 11:15:02 +01:00
Markus Reiter
0184e271d8 Fix RuboCop offenses. 2020-11-17 11:09:55 +01:00
Markus Reiter
9f458142b7
Merge pull request #9146 from reitermarkus/upgrade
Mention `--greedy` when no casks were upgraded.
2020-11-16 22:03:10 +01:00
Markus Reiter
3b7404560a Exclude casks and formulae with and without /. 2020-11-16 20:44:10 +01:00