google-style 0.2.0 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -5
- data/google-style.yml +192 -12
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8b6fc152c4c0d78c5e933d64a1a9b5fd355aaa18f9e889efe073994b75a4379
|
4
|
+
data.tar.gz: e3e0dbcdfd7beb63b8201d1083c3bbad01a0c46069edbe23ed0e0247e356857b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36145174df5f7281ac6d953b806a55d9ac3422ce2a5f66ea9b5e64e93dfa30dc0e61d8386d118231d055a49731fa7ae186b3ed0be3e106de97c0fdf8217fd4d7
|
7
|
+
data.tar.gz: 976ea6551cd0d27b8b6cc412fd5d7920667181f6569698206f78225fef423690ca65b8aa913e0a39405e06b4327aa149e208705d61c8e701f009ad3eeb503fe0
|
data/README.md
CHANGED
@@ -31,6 +31,16 @@ And run:
|
|
31
31
|
bundle exec rubocop
|
32
32
|
```
|
33
33
|
|
34
|
+
## Versioning
|
35
|
+
|
36
|
+
For all `1.x.x` gem versions:
|
37
|
+
|
38
|
+
- The target and required Ruby version will match the minor gem version. `1.24.0` targets Ruby 2.4. When `1.25.0` is released, it will target Ruby 2.5, and `1.30.0` will target Ruby 3.0.
|
39
|
+
|
40
|
+
- During a minor version bump, the rubocop dependency will be updated to the latest version.
|
41
|
+
|
42
|
+
- For these reasons, it is highly recommended that dependencies specify at least a specific minor version of this gem.
|
43
|
+
|
34
44
|
## Contributing
|
35
45
|
|
36
46
|
Contributions to this library are always welcome and highly encouraged.
|
@@ -51,11 +61,12 @@ This library is licensed under Apache 2.0. Full license text is available in
|
|
51
61
|
|
52
62
|
## Supported Ruby Versions
|
53
63
|
|
54
|
-
These libraries are currently supported on Ruby 2.
|
64
|
+
These libraries are currently supported on Ruby 2.4+.
|
55
65
|
|
56
66
|
Google provides official support for Ruby versions that are actively supported
|
57
67
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
58
|
-
in security maintenance, and not end of life. Currently, this means Ruby 2.
|
59
|
-
and later.
|
60
|
-
|
61
|
-
|
68
|
+
in security maintenance, and not end of life. Currently, this means Ruby 2.4
|
69
|
+
and later. Starting with Ruby 2.4, minor releases of the google-style gem under
|
70
|
+
`1.x.x` will correspond with the required Ruby version, with `1.24.x` requiring
|
71
|
+
Ruby 2.4.
|
72
|
+
See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
|
data/google-style.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Copyright 2019 Google LLC
|
2
|
-
|
2
|
+
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
5
5
|
# You may obtain a copy of the License at
|
6
|
-
|
6
|
+
#
|
7
7
|
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
|
8
|
+
#
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -13,40 +13,220 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
AllCops:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
NewCops: disable
|
17
|
+
SuggestExtensions: false
|
18
|
+
TargetRubyVersion: 2.5
|
19
|
+
|
20
|
+
# Enforcing a blank line often worsens vertical layout.
|
20
21
|
Layout/EmptyLineAfterGuardClause:
|
21
22
|
Enabled: false
|
22
|
-
|
23
|
+
|
24
|
+
# For the extra line between copyright and code.
|
25
|
+
Layout/EmptyLines:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
# This tends to be problematic, especially for nested hashes. In many cases,
|
29
|
+
# our code adheres to the "table" style, but we do not want to enforce it.
|
30
|
+
Layout/HashAlignment:
|
23
31
|
Enabled: false
|
32
|
+
|
33
|
+
# Our current preferred line length.
|
34
|
+
Layout/LineLength:
|
35
|
+
Max: 120
|
36
|
+
|
37
|
+
# Added in Rubocop 1.7
|
38
|
+
Layout/SpaceBeforeBrackets:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
# Added in Rubocop 1.7
|
42
|
+
Lint/AmbiguousAssignment:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
# Added in Rubocop 1.8
|
46
|
+
Lint/DeprecatedConstants:
|
47
|
+
Enabled: true
|
48
|
+
|
49
|
+
# Added in Rubocop 1.3
|
50
|
+
Lint/DuplicateBranch:
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
# Added in Rubocop 1.1
|
54
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
# Added in Rubocop 1.1
|
58
|
+
Lint/EmptyBlock:
|
59
|
+
Enabled: true
|
60
|
+
|
61
|
+
# Added in Rubocop 1.3
|
62
|
+
Lint/EmptyClass:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
# Added in Rubocop 1.8
|
66
|
+
Lint/LambdaWithoutLiteralBlock:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
# Added in Rubocop 1.2
|
70
|
+
Lint/NoReturnInBeginEndBlocks:
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
# Added in Rubocop 1.9
|
74
|
+
Lint/NumberedParameterAssignment:
|
75
|
+
Enabled: true
|
76
|
+
|
77
|
+
# Added in Rubocop 1.9
|
78
|
+
Lint/OrAssignmentToConstant:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
# Added in Rubocop 1.8
|
82
|
+
Lint/RedundantDirGlobSort:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
# Added in Rubocop 1.9
|
86
|
+
Lint/SymbolConversion:
|
87
|
+
Enabled: true
|
88
|
+
|
89
|
+
# Added in Rubocop 1.1
|
90
|
+
Lint/ToEnumArguments:
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
# Added in Rubocop 1.9
|
94
|
+
Lint/TripleQuotes:
|
95
|
+
Enabled: true
|
96
|
+
|
97
|
+
# Added in Rubocop 1.5
|
98
|
+
Lint/UnexpectedBlockArity:
|
99
|
+
Enabled: true
|
100
|
+
|
101
|
+
# Added in Rubocop 1.1
|
102
|
+
Lint/UnmodifiedReduceAccumulator:
|
103
|
+
Enabled: true
|
104
|
+
|
24
105
|
Metrics/AbcSize:
|
25
106
|
Max: 30
|
107
|
+
|
26
108
|
Metrics/CyclomaticComplexity:
|
27
109
|
Max: 10
|
28
|
-
|
29
|
-
Max: 120
|
110
|
+
|
30
111
|
Metrics/MethodLength:
|
31
112
|
Max: 25
|
113
|
+
|
114
|
+
# Sometimes problematic for API calls which might have a lot of parameters,
|
115
|
+
# and for generated code.
|
32
116
|
Metrics/ParameterLists:
|
33
117
|
Enabled: false
|
118
|
+
|
34
119
|
Metrics/PerceivedComplexity:
|
35
120
|
Max: 10
|
121
|
+
|
122
|
+
# Does not allow distinguishing verbs (e.g. is vs has). Also causes problems
|
123
|
+
# for generated code that might have generated method names.
|
124
|
+
Naming/PredicateName:
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
# Numbers are occasionally semantically useful in names, and also occasionally
|
128
|
+
# appear in generated code.
|
36
129
|
Naming/VariableNumber:
|
37
130
|
Enabled: false
|
131
|
+
|
132
|
+
# Better to separate accessors for yardoc and type declarations.
|
133
|
+
Style/AccessorGrouping:
|
134
|
+
EnforcedStyle: separated
|
135
|
+
|
136
|
+
# Added in Rubocop 1.1
|
137
|
+
Style/ArgumentsForwarding:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
# Problematic for generated code which might include unicode in comments.
|
141
|
+
Style/AsciiComments:
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
# There are cases where we use the === operator as a general interface, e.g.
|
145
|
+
# when specifying type checker objects.
|
146
|
+
Style/CaseEquality:
|
147
|
+
Enabled: false
|
148
|
+
|
149
|
+
# Added in Rubocop 1.2
|
150
|
+
Style/CollectionCompact:
|
151
|
+
Enabled: true
|
152
|
+
|
153
|
+
# Added in Rubocop 1.1
|
154
|
+
Style/DocumentDynamicEvalDefinition:
|
155
|
+
Enabled: true
|
156
|
+
|
157
|
+
# We prefer consistent method indentation.
|
158
|
+
Style/EmptyMethod:
|
159
|
+
EnforcedStyle: expanded
|
160
|
+
|
161
|
+
# Added in Rubocop 1.8
|
162
|
+
Style/EndlessMethod:
|
163
|
+
Enabled: true
|
164
|
+
|
165
|
+
# Frozen string literals are no more as of Ruby 3.
|
38
166
|
Style/FrozenStringLiteralComment:
|
39
167
|
Enabled: false
|
168
|
+
|
169
|
+
# Added in Rubocop 1.7
|
170
|
+
Style/HashExcept:
|
171
|
+
Enabled: true
|
172
|
+
|
173
|
+
# It is sometimes preferable to use the non-modifier form even for single-line
|
174
|
+
# expressions, for readability.
|
175
|
+
Style/IfUnlessModifier:
|
176
|
+
Enabled: false
|
177
|
+
|
178
|
+
# Added in Rubocop 1.9
|
179
|
+
Style/IfWithBooleanLiteralBranches:
|
180
|
+
Enabled: true
|
181
|
+
|
182
|
+
# We adopt Seattle-style paren usage
|
40
183
|
Style/MethodCallWithArgsParentheses:
|
184
|
+
AllowParenthesesInCamelCaseMethod: true
|
185
|
+
AllowParenthesesInChaining: true
|
186
|
+
AllowParenthesesInMultilineCall: true
|
41
187
|
Enabled: true
|
42
188
|
EnforcedStyle: omit_parentheses
|
43
|
-
|
44
|
-
|
189
|
+
|
190
|
+
# We adopt Seattle-style paren usage
|
45
191
|
Style/MethodDefParentheses:
|
46
192
|
EnforcedStyle: require_no_parentheses
|
193
|
+
|
194
|
+
# Enable use of the different semantics of module_function and extend self.
|
195
|
+
Style/ModuleFunction:
|
196
|
+
Enabled: false
|
197
|
+
|
198
|
+
# Added in Rubocop 1.2
|
199
|
+
Style/NegatedIfElseCondition:
|
200
|
+
Enabled: true
|
201
|
+
|
202
|
+
# Added in Rubocop 1.3
|
203
|
+
Style/NilLambda:
|
204
|
+
Enabled: true
|
205
|
+
|
206
|
+
# Added in Rubocop 1.4
|
207
|
+
Style/RedundantArgument:
|
208
|
+
Enabled: true
|
209
|
+
|
210
|
+
# The idiom is useful in a variety of cases. We prefer to allow it.
|
47
211
|
Style/RescueModifier:
|
48
212
|
Enabled: false
|
213
|
+
|
214
|
+
# We prefer standardizing on double-quoted strings for readability.
|
49
215
|
Style/StringLiterals:
|
50
216
|
EnforcedStyle: double_quotes
|
217
|
+
|
218
|
+
# Added in Rubocop 1.1
|
219
|
+
Style/SwapValues:
|
220
|
+
Enabled: true
|
221
|
+
|
222
|
+
# We prefer traditional bracket style for all arrays.
|
223
|
+
Style/SymbolArray:
|
224
|
+
EnforcedStyle: brackets
|
225
|
+
|
226
|
+
# There are some cases where a full method shows intent better than an attr.
|
51
227
|
Style/TrivialAccessors:
|
52
228
|
Enabled: false
|
229
|
+
|
230
|
+
# We prefer traditional bracket style for all arrays.
|
231
|
+
Style/WordArray:
|
232
|
+
EnforcedStyle: brackets
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Graham Paye
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,14 +76,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements:
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 2.
|
79
|
+
version: 2.5.0
|
80
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
86
|
+
rubygems_version: 3.1.4
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Collection of rubocop rules
|