330 Commits

Author SHA1 Message Date
Mike McQuaid
6c4042f593 More Rubocop tweaks.
- Don't enforce hash rockets on external commands.
- Enabled accidentally disabled ParenthesesAsGroupedExpression.
2016-10-22 15:55:13 +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
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
cea796c09b Rename shared RuboCop config to .rubocop_common.yml. 2016-09-29 22:59:49 +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
14362a7e5f Include .simplecov in RuboCop. 2016-09-23 15:30:05 +02:00
Mike McQuaid
515f7b5255 Unify .rubocopy.yml files. 2016-09-19 11:18:09 +01:00
Mike McQuaid
69e4ad9809 Add Rubocop TODO list. 2016-09-17 16:14:14 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Dominyk Tiller
db2e9b8375
rubocop: reinstate hash_rockets
Temporarily.
2016-08-17 16:54:42 +01:00
Mike McQuaid
0dc2beef7b rubocop: remove Ruby 1.8 compatibility checks. 2016-08-17 09:19:56 +01: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
8e728d6604 style: unify indentation in RuboCop configuration
Some elements already used two-space indentation and we also prefer two
spaces in our Ruby code.

Closes #306.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-06-01 09:34:58 +02:00
Dominyk Tiller
a584711115 rubocop: disable Style/ConditionalAssignment
Closes Homebrew/homebrew#48708.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-02-01 18:32:22 +00:00
Bob W. Hogg
3e0828c29a Rubocop: upgrade to version 0.36.0
Stop using Style/TrailingComma as it is no longer recognized and start using
Style/TrailingCommaInArguments and Style/TrailingCommaInLiteral instead.

Closes Homebrew/homebrew#48144.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-17 16:26:49 +08:00
Dominyk Tiller
d21c8151d5 rubocop: enforce comma instead of consistent_comma
Ref b0c21eb9d4.
2015-11-10 19:14:49 +00:00
Mike McQuaid
657f4ca2ce rubocop: allow consistent trailing commas.
Makes diffs nicer. Could maybe be changed to `comma` to be stricter.
2015-09-09 09:42:21 +01:00
Martin Afanasjew
1c37ea2b73 rubocop: re-enable whitespace-related cops
The referenced issue was fixed in Rubocop 0.30.0 (Homebrew uses 0.33.0).

Closes Homebrew/homebrew#43515.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-03 02:41:55 +08:00
Xu Cheng
3b68215be7 rubocop: remove conflicted rules
Since trailing commas in method argument lists are a syntax error in
1.8, let's enforce the default rule of `TrailingComma`(i.e. `no_comma`)

Closes Homebrew/homebrew#42398.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-03 18:47:24 +08:00
Mike McQuaid
670ca78eaa Add Rubocop 1.8 tweaks. 2015-08-03 18:47:24 +08:00
Mike McQuaid
e4ef7f8cb7 Don't try to Rubocop vendored files. 2015-08-03 18:47:23 +08:00
Xu Cheng
6eba862388 rubocop: update style rules
Closes Homebrew/homebrew#42355.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-02 20:03:10 +08:00
Jack Nagel
eda5922eb4 Disable trailing comma style rule for Ruby 1.8 support 2015-05-12 21:06:48 -04:00
Jack Nagel
37b5fb2e1e Stop enforcing the use of "fail" instead of "raise"
We use raise everywhere else in the codebase.
2015-05-10 20:40:10 -04:00
Dominyk Tiller
3c2493f862 rubocop: update for 0.30.0
v0.30.0 has killed a couple of the methods being used and is throwing
warnings around like candy. This switches to the new methods.

Rubocops are obviously a matter of choice, and I’ve added choice here
based on what was said in previous PRs and my own personal views on
readability. Happy to be told to change things to different variables.

For upstream detail, see:

*
https://github.com/bbatsov/rubocop/blob/master/relnotes/v0.30.0.md#chang
es
* https://github.com/bbatsov/rubocop/pull/1721/files
* https://github.com/bbatsov/rubocop/pull/1655/files

Closes Homebrew/homebrew#38655.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-04-14 22:37:56 -07:00
Jack Nagel
c60454a72f Fix warning about using %w[] instead of %W[] 2015-01-24 21:08:26 -05:00
Mike McQuaid
6fe0c3a83b rubocop.yml: tweak rules to match existing format.
Don't want to enforce more than we need to.
2015-01-05 19:01:39 +00:00
Loic Nageleisen
86ec8fcff3 Add Rubocop style file.
Closes Homebrew/homebrew#33219.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-12-31 19:42:12 +00:00