330 Commits

Author SHA1 Message Date
Claudia
b36fd8ebd9 Fix brew audit Formula/formula.rb
Fix a regression introduced in PR #8542, which wouldn’t exclude
formulae and casks from stricter style checks properly unless tapped.
This caused `brew audit Formula/formula.rb` to report violations which
were not meant for formulae and casks.

The fix is to add Exclude patterns for formulae and casks in any
`git clone`d tap’s working tree.

Working outside of the productive Homebrew installation makes sure that
the latter doesn’t interfere with development, and vice versa.
It also helps track work in progress, especially if one tends to forget
things.
2020-11-16 20:01:48 +01:00
Markus Reiter
3ee66d8c0d Add type annotations related to upgrade. 2020-11-16 19:45:15 +01:00
Markus Reiter
bfe9598fa9 Disable Lint/DuplicateBranch cop for formulae and casks. 2020-11-16 03:13:39 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Jonathan Chang
5ce561c4d1 rubocop: fix Naming/MemoizedInstanceVariableName 2020-11-10 23:28:31 +11:00
Markus Reiter
ab33bc638d Add type signatures for UnpackStrategy::Zip. 2020-10-20 09:50:21 +02:00
Markus Reiter
73dc98d1c7 Adjust RuboCop rules for Sorbet. 2020-10-11 00:30:09 +02:00
Markus Reiter
c2a0ba8e87 Enable rubocop-sorbet. 2020-10-09 16:45:13 +02:00
Mike McQuaid
3923d331de
Fix brew style 2020-09-15 13:39:06 +01:00
Markus Reiter
7ecd64fc03 Fix .rubocop.yml for test fixtures. 2020-09-01 14:07:17 +02:00
Markus Reiter
6d6c59a1fd Simplify .rubocop_rspec.yml. 2020-09-01 12:52:59 +02:00
Markus Reiter
21d57a0c44 Move RuboCop rules into top-level .rubocop.yml. 2020-09-01 12:52:59 +02:00
Markus Reiter
2b029b2744 Remove need for separate .rubocop_cask.yml. 2020-09-01 12:52:59 +02:00
Rylan Polster
60ec30d41e formula: update license specification 2020-08-19 12:48:50 -04:00
Mike McQuaid
3a91c37e66
Fix RuboCop checks. 2020-08-19 17:12:32 +01:00
Mike McQuaid
754beb64fc
rubocop: exclude formula.rb from ClassLength.
We want to allow this class to grow larger still while still enforcing
this on other classes.
2020-08-04 14:03:11 +01:00
miccal
633dea1bb1 rubocop.yml: cask fixes for new style 2020-07-30 22:10:53 +08:00
Mike McQuaid
25db60ebbb
Unify (mostly) Homebrew code style
Make the Homebrew/cask and Homebrew/homebrew-core style more closely
match the rest of Homebrew.

To accomplish this:
- Run `brew cask style` to ensure we don't break style there when
  making changes or upgrading RuboCop in Homebrew/brew.
- Fix the HomepageMatchesUrl cop to better handle weird input.
- Remove the now unneeded `.rubocop_shared.yml`
- Fix the cask fixtures with `brew cask style --fix`.
- Share more style between Homebrew/brew, casks and formulae.
2020-07-27 12:57:40 +01:00
Mike McQuaid
4132ccbf66
rubocop.yml: remove formula exclusions.
These have now been fixed so are no longer needed.
2020-04-18 14:53:32 +01:00
Mike McQuaid
bc96428207
rubocop.yml: enable new rules. 2020-04-17 11:04:33 +01:00
Mike McQuaid
d52e870b07
rubocop: remove NewFormulaAudit.
This is no longer used anywhere.
2020-04-13 16:01:26 +01:00
Mike McQuaid
845c71270e
rubocop.yml: enable non-default checks.
Closes https://github.com/Homebrew/brew/pull/7258
2020-04-03 14:54:50 +01:00
Mike McQuaid
c040331468
rubocop: enable Style/TrailingBodyOnMethodDefinition.
This is default, more consistent with Ruby style and autocorrectable.

I have updated the usage in Homebrew/core to be consistent.
2020-03-14 19:46:23 +00:00
Mike McQuaid
4498303f9a
rubocop: adjust rules. 2020-03-13 21:16:18 +00:00
Mike McQuaid
cd3ced48e9
rubocop: set LineLength to 118.
GitHub diff UI wraps beyond 118 characters. This also allows enabling
`Style/IfUnlessModifier` (which autocorrects).
2020-03-12 20:39:53 +00:00
Mike McQuaid
c7c9f83ff6
rubocop.yml: reduce Max LineLength.
Fixed the formulae in homebrew/core. Slowly but surely...
2020-03-05 12:22:40 +00:00
Mike McQuaid
76711e3222
Fix Rubocop 0.78.0 failures. 2019-12-19 12:01:51 +00:00
Mike McQuaid
766fc4b301
Fix RuboCop 0.77.0 failures. 2019-11-28 15:10:50 +00:00
Mike McQuaid
a4f86ba973
Don’t require aligned arguments for taps. 2019-04-30 09:19:29 +01:00
Mike McQuaid
f76b083b91
Use FrozenStringLiteralComment instead of flag.
Unfortunately we cannot use `--frozen-string-literal` with Ruby 2.3 due
to https://bugs.ruby-lang.org/issues/12031 and our usage of ERB.
2019-04-20 13:25:33 +09:00
Mike McQuaid
e095da4d01
rubocop: enable Layout/EmptyLineAfterGuardClause. 2019-02-21 12:55:49 +00:00
Mike McQuaid
5c7fbaf259
Update RuboCop RSpec rules
Create a new, seperate RuboCop file that uses our RSpec rule
configuration if a specified tap has a `spec` directory.

Also, while we're here, fix up the various rules so that we don't have
any outdated TODOs, disable some rules for good and fix `brew style`
for Homebrew/bundle.
2019-01-21 13:39:11 +00:00
Mike McQuaid
b34994b085
.rubocop.yml: brew style fixes.
- uncomment `ModuleLength` disable.
- don't enforce hash rockets for external commands
2018-12-03 13:23:20 +01:00
Markus Reiter
f858a17e96 Deduplicate RuboCop config. 2018-11-13 05:01:13 +01:00
Markus Reiter
04908dcb19 Fix RuboCop for Casks. 2018-11-12 05:01:33 +01:00
Mike McQuaid
ec3e7b2ae5
.rubocop.yml: merge rubocop-cask configuration. 2018-11-08 15:54:47 +00:00
Mike McQuaid
acd7f5714e
rubocop.yml: configure Hash alignment. 2018-11-02 17:28:44 +00:00
Mike McQuaid
800853a28d
Vendor rubocop-rspec
We aren't going to vendor its dependencies because we already require
a systemwide installation of `rubocop` to work in your editor. This
avoids requiring users to manually do another
`gem install rubocop-rspec` to have their editor integration behave as
expected.
2018-10-14 12:11:54 -07:00
Mike McQuaid
960207295b
rubocop.yml: reduce linelength. 2018-10-13 18:45:39 -07:00
Jan Viljanen
ce530fd0f5 move rspec pattern 2018-10-09 22:10:25 +02:00
Jan Viljanen
aa6912425e rubocop: move rspec include to root config file
To avoid confusion and bugs in rubocop robucop-spec should be required
from the root config.
2018-10-08 20:08:38 +02:00
commitay
737c9ad816 Library/.rubocop.yml: disable RescueEnsureAlignment 2018-09-18 10:30:59 +10:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Mike McQuaid
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Mike McQuaid
718a2112d7 rubocop.yml: adjust rules for 0.53.0. 2018-03-08 14:10:02 +00:00
ilovezfs
da77f23bc7 rubocop: don't always display cop names. 2018-01-21 07:23:53 -08:00
Mike McQuaid
8cd0d85afb rubocop 0.52.1 2018-01-15 16:17:32 +00:00
Mike McQuaid
5a8d2352c2 rubocop.yml: reduce tap maximum line length. 2017-10-27 14:20:33 +01:00
Mike McQuaid
1f259c2777 rubocop: disable length checks.
We should keep these enabled for Homebrew/brew but for taps these just
end up being annoying and making `brew style` fail for little benefit
2017-10-26 15:52:14 +01:00