google-style 0.3.1 → 1.25.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3766fcaa700233899393457f859fd5c4f185a1e50913738e22e9d37415613ca4
4
- data.tar.gz: 224221a70e56e52846c158e9417d9bbe944fe5fcb2ca3d564e2c56a8ecf62bf1
3
+ metadata.gz: 642e8669ef6ba1abaf3f85c254735d0282f39dbdc3b09335a3bfdb0d8112909e
4
+ data.tar.gz: f9bec1c16dda8668e61e272f8d1e9c3137bfa843bc4ccedd3d0cb5c24c69338a
5
5
  SHA512:
6
- metadata.gz: 9b9be7e30cdaa4a52728bef817b3957a43c2912b60c1627a35a94cf1ed4504891d4bde133c4a7b17a15df64c1a44b77013a38dfc00528b6024fe561700de6d55
7
- data.tar.gz: 9324def8ed182cada27e08a0fd98a7766bda0f0ace71dba848d6857cde9d2a2bdd0a697080f80caa3f633a88a56505e06eaae3adbea410ac445969e8ec6b9c58
6
+ metadata.gz: dfcfe24caf4cf56e27f5368cc7054f8ca63a8073ca8eb3f8f8e916496bafb6e52a479b8458c607e3ee03ec2e246bf19eadd582ad6bd03824550994252da89ca7
7
+ data.tar.gz: ef48b6b27a48bf78501f0d9dee7a771943a1dfadb98c9916aaa158ca6846e735c5446f0a194b2f7ad2eaa87907ce109dd16b38d90a093c977380e5c96bdba35a
data/README.md CHANGED
@@ -31,17 +31,27 @@ 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.
37
47
 
38
- See the [Contributing
39
- Guide](CONTRIBUTING.md)
48
+ See the {file:CONTRIBUTING.md Contributing
49
+ Guide}
40
50
  for more information on how to get started.
41
51
 
42
52
  Please note that this project is released with a Contributor Code of Conduct. By
43
- participating in this project you agree to abide by its terms. See the [Code of
44
- Conduct](CODE_OF_CONDUCT.md)
53
+ participating in this project you agree to abide by its terms. See the {file:CODE_OF_CONDUCT.md Code of
54
+ Conduct}
45
55
  for more information.
46
56
 
47
57
  ## License
@@ -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.3+.
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.3
59
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
60
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
61
- about the Ruby support schedule.
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,47 +13,225 @@
13
13
  # limitations under the License.
14
14
 
15
15
  AllCops:
16
- TargetRubyVersion: 2.3
17
- Layout/AlignHash:
18
- EnforcedHashRocketStyle: table
19
- EnforcedColonStyle: table
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
- Layout/EmptyLines: # for the extra line between copyright and code
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
- Metrics/LineLength:
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.
38
158
  Style/EmptyMethod:
39
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.
40
166
  Style/FrozenStringLiteralComment:
41
167
  Enabled: false
42
- Style/MethodCallWithArgsParentheses:
168
+
169
+ # Added in Rubocop 1.7
170
+ Style/HashExcept:
43
171
  Enabled: true
44
- EnforcedStyle: omit_parentheses
45
- AllowParenthesesInMultilineCall: 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
183
+ Style/MethodCallWithArgsParentheses:
46
184
  AllowParenthesesInCamelCaseMethod: true
47
185
  AllowParenthesesInChaining: true
186
+ AllowParenthesesInMultilineCall: true
187
+ Enabled: true
188
+ EnforcedStyle: omit_parentheses
189
+
190
+ # We adopt Seattle-style paren usage
48
191
  Style/MethodDefParentheses:
49
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
+ # Disabled because we prefer to keep begin-end blocks in memoization for
211
+ # readability (see https://github.com/rubocop/rubocop/pull/9602).
212
+ Style/RedundantBegin:
213
+ Enabled: false
214
+
215
+ # The idiom is useful in a variety of cases. We prefer to allow it.
50
216
  Style/RescueModifier:
51
217
  Enabled: false
218
+
219
+ # We prefer standardizing on double-quoted strings for readability.
52
220
  Style/StringLiterals:
53
221
  EnforcedStyle: double_quotes
222
+
223
+ # Added in Rubocop 1.1
224
+ Style/SwapValues:
225
+ Enabled: true
226
+
227
+ # We prefer traditional bracket style for all arrays.
54
228
  Style/SymbolArray:
55
229
  EnforcedStyle: brackets
230
+
231
+ # There are some cases where a full method shows intent better than an attr.
56
232
  Style/TrivialAccessors:
57
233
  Enabled: false
234
+
235
+ # We prefer traditional bracket style for all arrays.
58
236
  Style/WordArray:
59
237
  EnforcedStyle: brackets
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ module Google
18
+ module Style
19
+ VERSION = "1.25.2"
20
+ end
21
+ end
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: 0.3.1
4
+ version: 1.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graham Paye
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-13 00:00:00.000000000 Z
11
+ date: 2021-09-23 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: 0.64.0
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: 0.64.0
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: '1.17'
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: '1.17'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -64,7 +64,8 @@ files:
64
64
  - LICENSE
65
65
  - README.md
66
66
  - google-style.yml
67
- homepage: https://github.com/googleapis/ruby-style/tree/master/
67
+ - lib/google/style/version.rb
68
+ homepage: https://github.com/googleapis/ruby-style/
68
69
  licenses:
69
70
  - Apache-2.0
70
71
  metadata: {}
@@ -76,15 +77,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
77
  requirements:
77
78
  - - ">="
78
79
  - !ruby/object:Gem::Version
79
- version: 2.3.0
80
+ version: 2.5.0
80
81
  required_rubygems_version: !ruby/object:Gem::Requirement
81
82
  requirements:
82
83
  - - ">="
83
84
  - !ruby/object:Gem::Version
84
85
  version: '0'
85
86
  requirements: []
86
- rubyforge_project:
87
- rubygems_version: 2.7.6.2
87
+ rubygems_version: 3.2.17
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Collection of rubocop rules