66 Commits

Author SHA1 Message Date
Andrew Janke
8b55cb5ecb Refactor commands to remove "require cmd/help" 2018-06-07 04:59:59 -04:00
Andrew Janke
996825dd27 Split out rspec-specific Rubocop config to fix warning 2018-06-07 00:23:44 -04:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
58017511a8 style: add optional rubocop-rspec support.
It's really noisy and too pedantic for us to use now but I got it
working locally and used `--fix` to generate #3981 so let's add it as an
option for now.
2018-03-25 13:34:57 +01:00
EricFromCanada
1d2b4ed321 docs: add more missing option descriptions
and improve wording or formatting where necessary.
2018-02-01 16:06:17 -05:00
Mike McQuaid
8cd0d85afb rubocop 0.52.1 2018-01-15 16:17:32 +00:00
Mike McQuaid
1bd7d7df04 Use parser 2.4.0.0
This matches the version that supports Ruby 2.3.3 syntax (which is the
version we use).
2018-01-07 14:29:19 +00:00
Markus Reiter
71b6e239d7 Set RuboCop maximum to current maximum. 2017-10-10 17:00:04 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Gautham Goli
17e2753053 audit: Use version pinned by brew while executing rubocop cli 2017-09-20 13:26:50 +05:30
Gautham Goli
086e540231 Add a rubocop config file to control cops' execution in audit and style 2017-07-18 20:23:03 +05:30
Gautham Goli
5b3231ea0a style: disable NewFormulaAudit cops' execution by default unless specified 2017-07-15 22:40:26 +05:30
Mike McQuaid
81dbc29566 Merge pull request #2853 from GauthamGoli/disable-strict-cops-brew-style
style: Don't run FormulaAuditStrict cops when `brew style foo` cmd is executed
2017-07-07 15:43:55 +01:00
Gautham Goli
e9dfa736bf style: Don't run FormulaAuditStrict cops when brew style some_formula cmd is executed 2017-07-03 12:54:04 +05:30
Gautham Goli
8c167b23cc audit: Don't run audit methods when --only-cops is passed 2017-06-30 20:25:12 +05:30
Mike McQuaid
021cef4b2b Autocorrect Rubocop Style/SpecialGlobalVars. 2017-06-12 09:11:42 +01:00
Markus Reiter
7c0a3a1233 Fix rubocop in brew audit. 2017-06-03 23:50:31 +02:00
Mike McQuaid
4356016b4a Use parallel RuboCop
This requires updating to Rubocop 0.49.0 which will require some fixes
to rules, in Homebrew/brew and Homebrew/homebrew-core but opening this
for now so I remember.
2017-05-29 18:42:02 +01:00
Markus Reiter
54c4580871 Use XDG_CACHE_HOME for RuboCop. 2017-05-29 01:31:38 +02:00
Markus Reiter
5828eefd01 Remove to_s from some Pathnames. 2017-05-08 13:37:28 +02:00
Mike McQuaid
57db2e539e Revert "Merge pull request #2597 from MikeMcQuaid/vendor-gems"
This reverts commit 3e4547f52e7ebec633f8bfefc8a396d944edf908, reversing
changes made to 6edf9382bcc1240ad6f97c8b752cfe56cef9965d.
2017-05-07 17:28:39 +01:00
Mike McQuaid
ee253e465b Vendor all Homebrew's gems.
Homebrew's actually ended up using a fair few gems. While we want to
avoid Bundler at runtime (and this PR still does that, in fact uses
Bundler even less at runtime than it did before) writing our own version
to use at build-time seems redundant.
2017-05-07 13:52:57 +01:00
Mike McQuaid
6a15cea0b4 style: fix audit --online
This passed a symbol to `:except_cops` which caused a 💥.
2017-05-03 12:58:08 +01:00
Mike McQuaid
1c43070e69 style: don't require rubocop until installed.
This avoids an error when RuboCop installed installed yet.

CC @GauthamGoli FYI.
2017-05-03 12:09:18 +01:00
Gautham Goli
fed668b330 Add --only-cops,--except-cops options for brew style and simplify cop names 2017-05-03 14:49:23 +05:30
Gautham Goli
c3330c289d Add --only-cops,--except-cops options for brew audit
Also refactor audit cops into two "departments"
 - FormulaAudit
 - FormulaAuditStrict
2017-05-02 23:26:12 +05:30
Gautham Goli
a4568a8697 Let cops run without --strict flag 2017-05-02 23:14:44 +05:30
Mike McQuaid
fe59fde8f8 style: improve Rubocop error handling.
- Check if the JSON is definitely invalid (< 2 characters)
- Output the arguments that were passed to Rubocop
2017-03-08 09:26:07 +00:00
Markus Reiter
f48857d246 Use constants for RuboCop version. 2017-02-12 23:06:35 +01:00
Dominyk Tiller
c2b3f1db27
style: update rubocop to 0.47.1 2017-01-27 21:32:50 +00:00
William Woodruff
d07b9ed7f2
Replace Utils::JSON with corelib JSON calls. 2016-11-20 20:06:25 -05:00
Markus Reiter
e9391481a8 Update RuboCop to 0.45.0. 2016-11-13 23:18:08 +01:00
Mike McQuaid
1f963267b6 Update Rubocop style.
Another look at the current Rubocop rules and how they fit with our
existing and desired future style. Almost all of these changes were
automatic. Split some rules between formulae/brew where brew doesn't
have millions of cases that need fixed.
2016-10-22 13:32:46 +01:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
84c29fcf1f Fix JSON output handling. 2016-10-01 17:04:44 +01:00
Mike McQuaid
5b31507fda Use Library/.rubocop.yml file.
This allows having a shared style that’s use for Homebrew/brew and taps
which can be overridden by Homebrew/brew.
2016-10-01 12:13:09 +01:00
Markus Reiter
18a9945ad8 cd to HOMEBREW_LIBRARY is not needed anymore for RuboCop. 2016-09-29 22:58:41 +02:00
Markus Reiter
5800f2f084 Use separate .rubocop.yml in Library/Taps and Library/Homebrew. 2016-09-29 22:58:41 +02:00
Markus Reiter
70fc825787 Use separate RuboCop configs for formulae and core code. 2016-09-29 22:58:41 +02:00
Markus Reiter
ce6994b001 RuboCop has to be run inside HOMEBREW_LIBRARY. 2016-09-23 15:30:06 +02:00
Markus Reiter
21e0a7efb9 Update rubocop dependency to 0.43.0. 2016-09-23 15:30:06 +02:00
Mike McQuaid
263a8a0b73 style: no args default to Library/Homebrew. 2016-09-19 11:18:10 +01:00
Mike McQuaid
3686243e5a style: don't require HOMEBREW_DEVELOPER to fix. 2016-09-19 11:18:09 +01:00
Mike McQuaid
e79f62b2ea style: allow passing taps as arguments. 2016-09-19 11:18:09 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Margaret Lewicka
b512834243 audit: prevent crash from nil exitstatus (#532)
If rubocop invocation from brew audit exits with nil exitstatus,
brew audit fails with 'undefined method `>' for nil:NilClass'.
2016-07-16 22:58:47 +02:00
Martin Afanasjew
768ba34b14 style: use RuboCop 0.41.2, adjust defaults (#489)
Changes to our style configuration:

- Consolidate all rules related to Ruby 1.8 compatibility in one place.
- Codify our de-facto preference for `alias_method` over `alias` (drops
  offense count by 54 after turning this on).
- Drop `Style/SignalException` as `only_raise` has been the new default
  for quite a while (since RuboCop 0.37.0).
2016-07-12 07:49:55 +02:00
Martin Afanasjew
a49f3a8e91 style: use RuboCop 0.41.1 (#433)
Tweak `Style/NumericLiteralPrefix` cop settings as we're using octal
literals a lot (both in formulae and the package manager) for file
permissions and aren't ready just yet to transition them to the more
beginner-friendly `0o` prefix (instead of the more obscure `0` prefix).
2016-07-04 07:19:44 +02:00
Martin Afanasjew
8b97a00036 style: use RuboCop 0.40 2016-06-01 09:34:58 +02:00
Andrew Janke
a3b70d38a7 brew-audit: pull style checks in to main audit output
This collects all violations for each formula in a single place, instead
of doing `brew style` outputs for all formulae first, and then the other
audit checks.

Closes #112.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 14:45:33 -04:00