netsoft-rubocop 1.0.2 → 1.1.3.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/TODO.md +4 -0
- data/config/default.yml +291 -0
- data/lib/netsoft/rubocop/cops/{auth_http_positional_arguments.rb → netsoft/auth_http_positional_arguments.rb} +5 -6
- data/lib/netsoft/rubocop/cops/netsoft_cops.rb +3 -0
- data/lib/netsoft/rubocop/inject.rb +18 -0
- data/lib/netsoft/rubocop/version.rb +1 -1
- data/lib/netsoft/rubocop.rb +6 -1
- data/lib/netsoft-rubocop.rb +11 -0
- metadata +49 -38
- data/.circleci/config.yml +0 -141
- data/.gitignore +0 -56
- data/.rubocop.yml +0 -1
- data/Dangerfile +0 -3
- data/Gemfile +0 -8
- data/Rakefile +0 -4
- data/bin/setup-rubygems.sh +0 -3
- data/bin/tag_check.sh +0 -17
- data/default.yml +0 -124
- data/netsoft-rubocop.gemspec +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43c5f6140cb57936431a1eb6d8736dffeaff0d581098906dd830c755ba9d7ef4
|
4
|
+
data.tar.gz: d6583255ec92163e3799ac9d5dc2fc52763843cb3eba53f2295d64d9305c0cc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3564de283848dc3880fa55f64904a281aed3a86a7e1d70bfb65edbce2ca637a78ca9238653e010ab297d9d3eaf43331b42083584a95503b8024f1daa9ddfee2b
|
7
|
+
data.tar.gz: fe4f50ea5f47770ed185639f080099d8573938c67fee39e382c4390ea762741022a809a3c1bbc1a15c738befd6d6c3856019af2d26315e868184776a31e934e3
|
data/CHANGELOG.md
CHANGED
@@ -6,7 +6,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
|
+
### Added
|
10
|
+
### Changed
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
## [1.1.3] - 2021-05-10
|
14
|
+
### Changed
|
15
|
+
- update rubocop, and rubocop-[everything] to latest versions
|
9
16
|
|
17
|
+
## [1.1.2] - 2021-01-27
|
18
|
+
### Changed
|
19
|
+
- adjust array and hash indent rules to be default 2 space indent
|
20
|
+
- removed override config for Layout/MultilineMethodCallIndentation
|
21
|
+
|
22
|
+
## [1.1.1] - 2021-01-21
|
23
|
+
### Fixed
|
24
|
+
- fixed path in config
|
25
|
+
|
26
|
+
## [1.1.0] - 2021-01-20
|
27
|
+
### Changed
|
28
|
+
- Switch to newest versions of rubocop, and rubocop-[everything]
|
29
|
+
- Update the default config with the recent set of rules corresponding to the new version
|
30
|
+
- reworked gem so that it can simply be required like other rubocop gems
|
10
31
|
|
11
32
|
## [1.0.2] - 2020-09-09
|
12
33
|
### Changed
|
data/TODO.md
ADDED
data/config/default.yml
ADDED
@@ -0,0 +1,291 @@
|
|
1
|
+
require:
|
2
|
+
- ../lib/netsoft/rubocop/cops/netsoft/auth_http_positional_arguments
|
3
|
+
- rubocop-rails
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-rspec
|
6
|
+
- rubocop-rake
|
7
|
+
|
8
|
+
AllCops:
|
9
|
+
TargetRubyVersion: 2.5
|
10
|
+
TargetRailsVersion: 5.2
|
11
|
+
DisplayStyleGuide: true
|
12
|
+
StyleGuideBaseURL: https://rubystyle.guide
|
13
|
+
NewCops: enable
|
14
|
+
Exclude:
|
15
|
+
- 'db/**/*'
|
16
|
+
- 'coverage/**/*'
|
17
|
+
- 'log/**/*'
|
18
|
+
- 'public/**/*'
|
19
|
+
- 'tmp/**/*'
|
20
|
+
- 'spec/dummy/**/*'
|
21
|
+
- 'vendor/**/*'
|
22
|
+
- 'gemfiles/**/*'
|
23
|
+
- 'node_modules/**/*'
|
24
|
+
|
25
|
+
# region Layout
|
26
|
+
Layout/AssignmentIndentation:
|
27
|
+
IndentationWidth: 4
|
28
|
+
|
29
|
+
Layout/ExtraSpacing:
|
30
|
+
AllowForAlignment: true
|
31
|
+
|
32
|
+
Layout/HashAlignment:
|
33
|
+
EnforcedHashRocketStyle: table
|
34
|
+
EnforcedColonStyle: table
|
35
|
+
|
36
|
+
Layout/FirstArrayElementIndentation:
|
37
|
+
EnforcedStyle: consistent
|
38
|
+
|
39
|
+
Layout/FirstHashElementIndentation:
|
40
|
+
EnforcedStyle: consistent
|
41
|
+
|
42
|
+
Layout/SpaceInsideBlockBraces:
|
43
|
+
EnforcedStyle: space
|
44
|
+
SpaceBeforeBlockParameters: true
|
45
|
+
|
46
|
+
Layout/SpaceInsideHashLiteralBraces:
|
47
|
+
EnforcedStyle: no_space
|
48
|
+
# endregion
|
49
|
+
|
50
|
+
# region Lint
|
51
|
+
Lint/AmbiguousBlockAssociation:
|
52
|
+
Exclude:
|
53
|
+
- spec/**/*
|
54
|
+
|
55
|
+
Lint/NonDeterministicRequireOrder:
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
Lint/StructNewOverride:
|
59
|
+
Enabled: false
|
60
|
+
#endregion
|
61
|
+
|
62
|
+
# region Naming
|
63
|
+
Naming/RescuedExceptionsVariableName:
|
64
|
+
PreferredName: ex
|
65
|
+
|
66
|
+
Naming/MemoizedInstanceVariableName:
|
67
|
+
EnforcedStyleForLeadingUnderscores: optional
|
68
|
+
|
69
|
+
Naming/MethodParameterName:
|
70
|
+
AllowedNames:
|
71
|
+
- at
|
72
|
+
- by
|
73
|
+
- db
|
74
|
+
- id
|
75
|
+
- in
|
76
|
+
- io
|
77
|
+
- ip
|
78
|
+
- of
|
79
|
+
- 'on'
|
80
|
+
- os
|
81
|
+
- pp
|
82
|
+
- to
|
83
|
+
- tz
|
84
|
+
- my
|
85
|
+
- me
|
86
|
+
- ex
|
87
|
+
- uo
|
88
|
+
- up
|
89
|
+
|
90
|
+
Naming/PredicateName:
|
91
|
+
# By default, it also forbids has_, but that's rarely a good suggestion:
|
92
|
+
# is #has_screenshots? => #screenshots? better?..
|
93
|
+
ForbiddenPrefixes:
|
94
|
+
- is_
|
95
|
+
|
96
|
+
Naming/VariableNumber:
|
97
|
+
Enabled: false
|
98
|
+
# endregion
|
99
|
+
|
100
|
+
# region Performance
|
101
|
+
Performance/CollectionLiteralInLoop:
|
102
|
+
Enabled: false
|
103
|
+
|
104
|
+
Performance/MethodObjectAsBlock:
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
# superseded by Performance/RgexpMatch
|
108
|
+
Performance/RedundantMatch:
|
109
|
+
Enabled: false
|
110
|
+
|
111
|
+
Performance/BlockGivenWithExplicitBlock:
|
112
|
+
Enabled: false
|
113
|
+
|
114
|
+
Performance/TimesMap:
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
# endregion
|
118
|
+
|
119
|
+
# region Rails
|
120
|
+
Rails:
|
121
|
+
Enabled: true
|
122
|
+
|
123
|
+
Rails/FilePath:
|
124
|
+
EnforcedStyle: arguments
|
125
|
+
|
126
|
+
# We do it on a DB level
|
127
|
+
Rails/HasManyOrHasOneDependent:
|
128
|
+
Enabled: false
|
129
|
+
|
130
|
+
Rails/HttpPositionalArguments:
|
131
|
+
Enabled: false
|
132
|
+
|
133
|
+
Rails/HttpStatus:
|
134
|
+
EnforcedStyle: numeric
|
135
|
+
|
136
|
+
Rails/SkipsModelValidations:
|
137
|
+
AllowedMethods:
|
138
|
+
- touch
|
139
|
+
- update_attribute
|
140
|
+
- update_counters
|
141
|
+
- increment_counter
|
142
|
+
- decrement_counter
|
143
|
+
|
144
|
+
Netsoft/AuthHttpPositionalArguments:
|
145
|
+
Enabled: true
|
146
|
+
Include:
|
147
|
+
- 'spec/controllers/**/*'
|
148
|
+
|
149
|
+
# endregion
|
150
|
+
|
151
|
+
# region RSpec
|
152
|
+
# Prohibits before/after(:all) for ever uses. But when we use it, we know what we do
|
153
|
+
RSpec/BeforeAfterAll:
|
154
|
+
Enabled: false
|
155
|
+
|
156
|
+
RSpec/ExpectChange:
|
157
|
+
EnforcedStyle: block
|
158
|
+
|
159
|
+
RSpec/ImplicitSubject:
|
160
|
+
Enabled: false
|
161
|
+
|
162
|
+
# Just prohibits `let!` for any usages
|
163
|
+
# Nice try, Rubocop.
|
164
|
+
RSpec/LetSetup:
|
165
|
+
Enabled: false
|
166
|
+
|
167
|
+
RSpec/MessageSpies:
|
168
|
+
Enabled: false
|
169
|
+
|
170
|
+
# TODO: It would be good to set a realistic Max: once, but we have all kind of specs with multiple
|
171
|
+
# expectations now.
|
172
|
+
RSpec/MultipleExpectations:
|
173
|
+
Enabled: false
|
174
|
+
|
175
|
+
# Allows to limit number of `let`s. What for?..
|
176
|
+
# NB: With current setting (5 max) we have... "Offense count: 22706"
|
177
|
+
RSpec/MultipleMemoizedHelpers:
|
178
|
+
Enabled: false
|
179
|
+
|
180
|
+
RSpec/NamedSubject:
|
181
|
+
Enabled: false
|
182
|
+
|
183
|
+
RSpec/NestedGroups:
|
184
|
+
Enabled: false
|
185
|
+
|
186
|
+
RSpec/NotToNot:
|
187
|
+
EnforcedStyle: to_not
|
188
|
+
|
189
|
+
# endregion
|
190
|
+
|
191
|
+
# region Style
|
192
|
+
|
193
|
+
# Allows to enforce either this:
|
194
|
+
#
|
195
|
+
# attr_reader :a
|
196
|
+
# attr_reader :b
|
197
|
+
#
|
198
|
+
# (all accessors separate), or this:
|
199
|
+
#
|
200
|
+
# attr_reader :a, :b
|
201
|
+
#
|
202
|
+
# (all accessors in one statement).
|
203
|
+
#
|
204
|
+
# We use both, and it is hard to tell why it should be limited...
|
205
|
+
Style/AccessorGrouping:
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Style/AndOr:
|
209
|
+
EnforcedStyle: conditionals
|
210
|
+
|
211
|
+
Style/BlockDelimiters:
|
212
|
+
EnforcedStyle: semantic
|
213
|
+
AllowBracesOnProceduralOneLiners: true
|
214
|
+
|
215
|
+
Style/CommentAnnotation:
|
216
|
+
Enabled: false
|
217
|
+
|
218
|
+
# Asks to write comment besides dynamically evaluated method, showing how the code would look,
|
219
|
+
# see cop docs: https://docs.rubocop.org/rubocop/cops_style.html#styledocumentdynamicevaldefinition
|
220
|
+
#
|
221
|
+
# Ideally, would be cool, but lot of work.
|
222
|
+
Style/DocumentDynamicEvalDefinition:
|
223
|
+
Enabled: false
|
224
|
+
|
225
|
+
Style/DoubleNegation:
|
226
|
+
Enabled: false
|
227
|
+
|
228
|
+
# Asks to write empty methods this way:
|
229
|
+
#
|
230
|
+
# def foo; end
|
231
|
+
#
|
232
|
+
Style/EmptyMethod:
|
233
|
+
Enabled: false
|
234
|
+
|
235
|
+
Style/FormatString:
|
236
|
+
EnforcedStyle: percent
|
237
|
+
|
238
|
+
Style/FormatStringToken:
|
239
|
+
Enabled: false
|
240
|
+
|
241
|
+
Style/HashAsLastArrayItem:
|
242
|
+
EnforcedStyle: no_braces
|
243
|
+
|
244
|
+
Style/Lambda:
|
245
|
+
EnforcedStyle: literal
|
246
|
+
|
247
|
+
Style/MultilineBlockChain:
|
248
|
+
Enabled: false
|
249
|
+
|
250
|
+
# FIXME: This cop requires to attach .freeze to each and every constant.
|
251
|
+
# It is both ugly AND doesn't protect from bugs (the freeze is shallow, so some frozen CONFIG hash
|
252
|
+
# can still be changed).
|
253
|
+
# We need to develop our own .deep_freeze for configs, and cops to check that it is attached to
|
254
|
+
# hashes, arrays and values fetched from ENV/configs.
|
255
|
+
Style/MutableConstant:
|
256
|
+
Enabled: false
|
257
|
+
|
258
|
+
Style/ParallelAssignment:
|
259
|
+
Enabled: false
|
260
|
+
|
261
|
+
Style/RescueModifier:
|
262
|
+
Enabled: false
|
263
|
+
|
264
|
+
# Asks to avoid `rescue => exception` without particular class.
|
265
|
+
# Why?..
|
266
|
+
Style/RescueStandardError:
|
267
|
+
Enabled: false
|
268
|
+
|
269
|
+
Style/SingleArgumentDig:
|
270
|
+
Enabled: false
|
271
|
+
|
272
|
+
Style/StringConcatenation:
|
273
|
+
Enabled: false
|
274
|
+
|
275
|
+
Style/StringLiterals:
|
276
|
+
# up for debate
|
277
|
+
Enabled: false
|
278
|
+
|
279
|
+
Style/StructInheritance:
|
280
|
+
Enabled: false
|
281
|
+
|
282
|
+
Style/TrailingCommaInArrayLiteral:
|
283
|
+
EnforcedStyleForMultiline: comma
|
284
|
+
|
285
|
+
Style/TrailingCommaInHashLiteral:
|
286
|
+
EnforcedStyleForMultiline: comma
|
287
|
+
|
288
|
+
#endregion
|
289
|
+
|
290
|
+
Metrics:
|
291
|
+
Enabled: false
|
@@ -37,7 +37,7 @@ module RuboCop
|
|
37
37
|
PATTERN
|
38
38
|
|
39
39
|
def on_send(node)
|
40
|
-
message =
|
40
|
+
message = MSG % {verb: node.method_name}
|
41
41
|
|
42
42
|
http_request?(node) do |data|
|
43
43
|
return unless needs_conversion?(data)
|
@@ -77,9 +77,9 @@ module RuboCop
|
|
77
77
|
code_to_replace = node.loc.expression
|
78
78
|
# what to replace with
|
79
79
|
format = parentheses_format(node)
|
80
|
-
new_code = format
|
80
|
+
new_code = format % {name: node.method_name,
|
81
81
|
action: has_auth ? [user.source, controller_action].join(',') : controller_action,
|
82
|
-
params: params, session: session
|
82
|
+
params: params, session: session}
|
83
83
|
->(corrector) { corrector.replace(code_to_replace, new_code) }
|
84
84
|
end
|
85
85
|
|
@@ -115,15 +115,14 @@ module RuboCop
|
|
115
115
|
return '' if data.hash_type? && data.empty?
|
116
116
|
|
117
117
|
hash_data = if data.hash_type?
|
118
|
-
|
119
|
-
data: data.pairs.map(&:source).join(', '))
|
118
|
+
'{ %<data>s }' % {data: data.pairs.map(&:source).join(', ')}
|
120
119
|
else
|
121
120
|
# user supplies an object,
|
122
121
|
# no need to surround with braces
|
123
122
|
data.source
|
124
123
|
end
|
125
124
|
|
126
|
-
|
125
|
+
', %<type>s: %<hash_data>s' % {type: type, hash_data: hash_data}
|
127
126
|
end
|
128
127
|
|
129
128
|
def parentheses_format(node)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Netsoft
|
4
|
+
module Rubocop
|
5
|
+
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
6
|
+
# bit of our configuration.
|
7
|
+
module Inject
|
8
|
+
def self.defaults!
|
9
|
+
path = CONFIG_DEFAULT.to_s
|
10
|
+
hash = ::RuboCop::ConfigLoader.send(:load_yaml_configuration, path)
|
11
|
+
config = ::RuboCop::Config.new(hash, path)
|
12
|
+
puts "configuration from #{path}" if ::RuboCop::ConfigLoader.debug?
|
13
|
+
config = ::RuboCop::ConfigLoader.merge_with_default(config, path)
|
14
|
+
::RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, config)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/netsoft/rubocop.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'yaml'
|
4
4
|
|
5
5
|
module Netsoft
|
6
6
|
# Hubstaff shared rubocop style configs
|
7
7
|
module Rubocop
|
8
|
+
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
9
|
+
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
10
|
+
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
11
|
+
|
12
|
+
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
8
13
|
end
|
9
14
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rubocop'
|
4
|
+
|
5
|
+
require_relative 'netsoft/rubocop'
|
6
|
+
require_relative 'netsoft/rubocop/version'
|
7
|
+
require_relative 'netsoft/rubocop/inject'
|
8
|
+
|
9
|
+
Netsoft::Rubocop::Inject.defaults!
|
10
|
+
|
11
|
+
require_relative 'netsoft/rubocop/cops/netsoft_cops'
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netsoft-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.3.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Yarotsky
|
8
|
+
- Edward Rudd
|
8
9
|
autorequire:
|
9
|
-
bindir:
|
10
|
+
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -28,94 +29,105 @@ dependencies:
|
|
28
29
|
name: rake
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
|
-
- - "
|
32
|
+
- - ">="
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: '12.0'
|
34
35
|
type: :development
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- - "
|
39
|
+
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '12.0'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
43
|
name: rubocop
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
|
-
- -
|
46
|
+
- - '='
|
46
47
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
+
version: 1.14.0
|
48
49
|
type: :runtime
|
49
50
|
prerelease: false
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
|
-
- -
|
53
|
+
- - '='
|
53
54
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
+
version: 1.14.0
|
55
56
|
- !ruby/object:Gem::Dependency
|
56
57
|
name: rubocop-performance
|
57
58
|
requirement: !ruby/object:Gem::Requirement
|
58
59
|
requirements:
|
59
|
-
- -
|
60
|
+
- - '='
|
60
61
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
+
version: 1.11.3
|
62
63
|
type: :runtime
|
63
64
|
prerelease: false
|
64
65
|
version_requirements: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- -
|
67
|
+
- - '='
|
67
68
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
+
version: 1.11.3
|
69
70
|
- !ruby/object:Gem::Dependency
|
70
71
|
name: rubocop-rails
|
71
72
|
requirement: !ruby/object:Gem::Requirement
|
72
73
|
requirements:
|
73
|
-
- -
|
74
|
+
- - '='
|
74
75
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
76
|
+
version: 2.10.1
|
76
77
|
type: :runtime
|
77
78
|
prerelease: false
|
78
79
|
version_requirements: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
|
-
- -
|
81
|
+
- - '='
|
81
82
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
83
|
+
version: 2.10.1
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rubocop-rake
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.5.1
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.5.1
|
83
98
|
- !ruby/object:Gem::Dependency
|
84
99
|
name: rubocop-rspec
|
85
100
|
requirement: !ruby/object:Gem::Requirement
|
86
101
|
requirements:
|
87
|
-
- -
|
102
|
+
- - '='
|
88
103
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
104
|
+
version: 2.3.0
|
90
105
|
type: :runtime
|
91
106
|
prerelease: false
|
92
107
|
version_requirements: !ruby/object:Gem::Requirement
|
93
108
|
requirements:
|
94
|
-
- -
|
109
|
+
- - '='
|
95
110
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
111
|
+
version: 2.3.0
|
97
112
|
description:
|
98
113
|
email:
|
99
114
|
- alex.yarotsky@hubstaff.com
|
115
|
+
- edward@hubstaff.com
|
100
116
|
executables: []
|
101
117
|
extensions: []
|
102
|
-
extra_rdoc_files:
|
118
|
+
extra_rdoc_files:
|
119
|
+
- README.md
|
103
120
|
files:
|
104
|
-
- ".circleci/config.yml"
|
105
|
-
- ".gitignore"
|
106
|
-
- ".rubocop.yml"
|
107
121
|
- CHANGELOG.md
|
108
|
-
- Dangerfile
|
109
|
-
- Gemfile
|
110
122
|
- README.md
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
114
|
-
- default.yml
|
123
|
+
- TODO.md
|
124
|
+
- config/default.yml
|
125
|
+
- lib/netsoft-rubocop.rb
|
115
126
|
- lib/netsoft/rubocop.rb
|
116
|
-
- lib/netsoft/rubocop/cops/auth_http_positional_arguments.rb
|
127
|
+
- lib/netsoft/rubocop/cops/netsoft/auth_http_positional_arguments.rb
|
128
|
+
- lib/netsoft/rubocop/cops/netsoft_cops.rb
|
129
|
+
- lib/netsoft/rubocop/inject.rb
|
117
130
|
- lib/netsoft/rubocop/version.rb
|
118
|
-
- netsoft-rubocop.gemspec
|
119
131
|
homepage: https://github.com/netsoftHoldings/netsoft-rubocop
|
120
132
|
licenses: []
|
121
133
|
metadata: {}
|
@@ -127,15 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
139
|
requirements:
|
128
140
|
- - ">="
|
129
141
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
142
|
+
version: '2.4'
|
131
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
144
|
requirements:
|
133
|
-
- - "
|
145
|
+
- - ">"
|
134
146
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
147
|
+
version: 1.3.1
|
136
148
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.7.7
|
149
|
+
rubygems_version: 3.0.3
|
139
150
|
signing_key:
|
140
151
|
specification_version: 4
|
141
152
|
summary: Hubstaff style guides and shared style configs.
|
data/.circleci/config.yml
DELETED
@@ -1,141 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
|
3
|
-
defaults: &defaults
|
4
|
-
docker: &ruby_image
|
5
|
-
- &ruby_image
|
6
|
-
image: circleci/ruby:2.4.4-stretch
|
7
|
-
environment:
|
8
|
-
CIRCLE_ARTIFACTS: /tmp/circelci-artifacts
|
9
|
-
RUBYOPT: '-KU -E utf-8:utf-8'
|
10
|
-
BUNDLE_PATH: vendor/bundle
|
11
|
-
BUNDLE_VERSION: 1.15.2
|
12
|
-
BUNDLE_JOBS: 4
|
13
|
-
BUNDLE_RETRY: 3
|
14
|
-
|
15
|
-
filters:
|
16
|
-
test: &filter_test
|
17
|
-
filters:
|
18
|
-
tags:
|
19
|
-
ignore: /^v.*/
|
20
|
-
beta: &filter_beta
|
21
|
-
filters:
|
22
|
-
branches:
|
23
|
-
ignore: /.*/
|
24
|
-
tags:
|
25
|
-
only: /^v[0-9]+(\.[0-9]+)+(\.[a-z].+).*/
|
26
|
-
release: &filter_release
|
27
|
-
filters:
|
28
|
-
branches:
|
29
|
-
ignore: /.*/
|
30
|
-
tags:
|
31
|
-
only: /^v[0-9]+(\.[0-9]+)+/
|
32
|
-
|
33
|
-
workflows:
|
34
|
-
version: 2
|
35
|
-
build_test:
|
36
|
-
jobs:
|
37
|
-
- "Checkout":
|
38
|
-
<<: *filter_test
|
39
|
-
context: org-global
|
40
|
-
- "Build":
|
41
|
-
<<: *filter_test
|
42
|
-
context: org-global
|
43
|
-
requires:
|
44
|
-
- "Checkout"
|
45
|
-
build_test_beta:
|
46
|
-
jobs:
|
47
|
-
- "Checkout":
|
48
|
-
<<: *filter_beta
|
49
|
-
context: org-global
|
50
|
-
- "Build":
|
51
|
-
<<: *filter_beta
|
52
|
-
context: org-global
|
53
|
-
requires:
|
54
|
-
- "Checkout"
|
55
|
-
- "Publish":
|
56
|
-
<<: *filter_beta
|
57
|
-
context: org-global
|
58
|
-
requires:
|
59
|
-
- "Build"
|
60
|
-
build_test_release:
|
61
|
-
jobs:
|
62
|
-
- "Checkout":
|
63
|
-
<<: *filter_release
|
64
|
-
context: org-global
|
65
|
-
- "Build":
|
66
|
-
<<: *filter_release
|
67
|
-
context: org-global
|
68
|
-
requires:
|
69
|
-
- "Checkout"
|
70
|
-
- "Publish":
|
71
|
-
<<: *filter_release
|
72
|
-
context: org-global
|
73
|
-
requires:
|
74
|
-
- "Build"
|
75
|
-
|
76
|
-
jobs:
|
77
|
-
"Checkout":
|
78
|
-
<<: *defaults
|
79
|
-
steps:
|
80
|
-
- attach_workspace:
|
81
|
-
at: .
|
82
|
-
- checkout
|
83
|
-
|
84
|
-
- restore_cache:
|
85
|
-
keys:
|
86
|
-
- netsoft-rubocop-bundle-v2-{{ checksum "Gemfile" }}-{{ checksum "netsoft-rubocop.gemspec" }}
|
87
|
-
- run:
|
88
|
-
name: Install bundler
|
89
|
-
command: gem install bundler --version=$BUNDLE_VERSION
|
90
|
-
- run:
|
91
|
-
name: Bundle Install
|
92
|
-
command: |-
|
93
|
-
bundle _${BUNDLE_VERSION}_ check || bundle _${BUNDLE_VERSION}_ install --retry=$BUNDLE_RETRY
|
94
|
-
- save_cache:
|
95
|
-
key: netsoft-rubocop--bundle-v2-{{ checksum "Gemfile" }}-{{ checksum "netsoft-rubocop.gemspec" }}
|
96
|
-
paths:
|
97
|
-
- vendor/bundle
|
98
|
-
- Gemfile.lock
|
99
|
-
|
100
|
-
- persist_to_workspace:
|
101
|
-
root: .
|
102
|
-
paths: .
|
103
|
-
"Build":
|
104
|
-
<<: *defaults
|
105
|
-
steps:
|
106
|
-
- attach_workspace:
|
107
|
-
at: .
|
108
|
-
- run:
|
109
|
-
name: Install bundler
|
110
|
-
command: gem install bundler --version=$BUNDLE_VERSION
|
111
|
-
- run:
|
112
|
-
name: Build gem
|
113
|
-
command: |-
|
114
|
-
gem build *.gemspec
|
115
|
-
- run:
|
116
|
-
name: "Install netsoft-danger"
|
117
|
-
command: |-
|
118
|
-
gem install netsoft-danger
|
119
|
-
- run:
|
120
|
-
name: Run rubocop
|
121
|
-
command: |-
|
122
|
-
netsoft-circle rubocop
|
123
|
-
- run:
|
124
|
-
name: Run Danger
|
125
|
-
command: |-
|
126
|
-
danger
|
127
|
-
- store_artifacts:
|
128
|
-
path: /tmp/circelci-artifacts
|
129
|
-
"Publish":
|
130
|
-
<<: *defaults
|
131
|
-
steps:
|
132
|
-
- attach_workspace:
|
133
|
-
at: .
|
134
|
-
- run:
|
135
|
-
name: Deploy to gem server
|
136
|
-
command: |-
|
137
|
-
./bin/tag_check.sh
|
138
|
-
./bin/setup-rubygems.sh
|
139
|
-
rm -rf pkg
|
140
|
-
rake build
|
141
|
-
gem push pkg/*.gem
|
data/.gitignore
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/spec/examples.txt
|
9
|
-
/test/tmp/
|
10
|
-
/test/version_tmp/
|
11
|
-
/tmp/
|
12
|
-
|
13
|
-
# Used by dotenv library to load environment variables.
|
14
|
-
# .env
|
15
|
-
|
16
|
-
# Ignore Byebug command history file.
|
17
|
-
.byebug_history
|
18
|
-
|
19
|
-
## Specific to RubyMotion:
|
20
|
-
.dat*
|
21
|
-
.repl_history
|
22
|
-
build/
|
23
|
-
*.bridgesupport
|
24
|
-
build-iPhoneOS/
|
25
|
-
build-iPhoneSimulator/
|
26
|
-
|
27
|
-
## Specific to RubyMotion (use of CocoaPods):
|
28
|
-
#
|
29
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
-
#
|
33
|
-
# vendor/Pods/
|
34
|
-
|
35
|
-
## Documentation cache and generated files:
|
36
|
-
/.yardoc/
|
37
|
-
/_yardoc/
|
38
|
-
/doc/
|
39
|
-
/rdoc/
|
40
|
-
|
41
|
-
## Environment normalization:
|
42
|
-
/.bundle/
|
43
|
-
/vendor/bundle
|
44
|
-
/lib/bundler/man/
|
45
|
-
|
46
|
-
# for a library or gem, you might want to ignore these files since the code is
|
47
|
-
# intended to run in multiple environments; otherwise, check them in:
|
48
|
-
# Gemfile.lock
|
49
|
-
# .ruby-version
|
50
|
-
# .ruby-gemset
|
51
|
-
|
52
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
-
.rvmrc
|
54
|
-
|
55
|
-
Gemfile.lock
|
56
|
-
.ruby-*
|
data/.rubocop.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
inherit_from: default.yml
|
data/Dangerfile
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/setup-rubygems.sh
DELETED
data/bin/tag_check.sh
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
tag=`git describe --tags --exact-match HEAD 2> /dev/null`
|
4
|
-
|
5
|
-
if [ $? -eq 0 ]; then
|
6
|
-
version=`grep VERSION lib/netsoft/rubocop/version.rb | sed -e "s/.*'\([^']*\)'.*/\1/"`
|
7
|
-
|
8
|
-
if [ "v$version" = "$tag" ]; then
|
9
|
-
echo "Revision $tag Matches $version"
|
10
|
-
else
|
11
|
-
echo "Revision $tag does not match $version"
|
12
|
-
exit 2
|
13
|
-
fi
|
14
|
-
else
|
15
|
-
echo "No tag found"
|
16
|
-
exit 1
|
17
|
-
fi
|
data/default.yml
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- ./lib/netsoft/rubocop/cops/auth_http_positional_arguments
|
3
|
-
- rubocop-rails
|
4
|
-
- rubocop-performance
|
5
|
-
- rubocop-rspec
|
6
|
-
|
7
|
-
AllCops:
|
8
|
-
TargetRubyVersion: 2.5
|
9
|
-
TargetRailsVersion: 5.2
|
10
|
-
DisplayStyleGuide: true
|
11
|
-
StyleGuideBaseURL: https://rubystyle.guide
|
12
|
-
Exclude:
|
13
|
-
- 'db/**/*'
|
14
|
-
- 'coverage/**/*'
|
15
|
-
- 'log/**/*'
|
16
|
-
- 'public/**/*'
|
17
|
-
- 'tmp/**/*'
|
18
|
-
- 'spec/dummy/**/*'
|
19
|
-
- 'vendor/**/*'
|
20
|
-
- 'gemfiles/**/*'
|
21
|
-
- 'node_modules/**/*'
|
22
|
-
|
23
|
-
Naming/RescuedExceptionsVariableName:
|
24
|
-
PreferredName: ex
|
25
|
-
|
26
|
-
Naming/UncommunicativeMethodParamName:
|
27
|
-
AllowedNames:
|
28
|
-
- me
|
29
|
-
- ex
|
30
|
-
|
31
|
-
Layout/AlignHash:
|
32
|
-
EnforcedHashRocketStyle: table
|
33
|
-
EnforcedColonStyle: table
|
34
|
-
|
35
|
-
Layout/ExtraSpacing:
|
36
|
-
AllowForAlignment: true
|
37
|
-
|
38
|
-
Layout/IndentAssignment:
|
39
|
-
IndentationWidth: 4
|
40
|
-
|
41
|
-
Layout/IndentFirstArrayElement:
|
42
|
-
EnforcedStyle: consistent
|
43
|
-
IndentationWidth: 4
|
44
|
-
|
45
|
-
Layout/IndentFirstHashElement:
|
46
|
-
EnforcedStyle: consistent
|
47
|
-
IndentationWidth: 4
|
48
|
-
|
49
|
-
Layout/MultilineMethodCallIndentation:
|
50
|
-
EnforcedStyle: indented_relative_to_receiver
|
51
|
-
IndentationWidth: 4
|
52
|
-
|
53
|
-
Layout/SpaceInsideBlockBraces:
|
54
|
-
EnforcedStyle: space
|
55
|
-
SpaceBeforeBlockParameters: true
|
56
|
-
|
57
|
-
Layout/SpaceInsideHashLiteralBraces:
|
58
|
-
EnforcedStyle: no_space
|
59
|
-
|
60
|
-
Lint/AmbiguousBlockAssociation:
|
61
|
-
Exclude:
|
62
|
-
- spec/**/*
|
63
|
-
|
64
|
-
Rails:
|
65
|
-
Enabled: true
|
66
|
-
|
67
|
-
Rails/HttpPositionalArguments:
|
68
|
-
Enabled: false
|
69
|
-
|
70
|
-
Rails/SkipsModelValidations:
|
71
|
-
Whitelist:
|
72
|
-
- touch
|
73
|
-
- update_attribute
|
74
|
-
- update_counters
|
75
|
-
- increment_counter
|
76
|
-
- decrement_counter
|
77
|
-
|
78
|
-
Netsoft/AuthHttpPositionalArguments:
|
79
|
-
Enabled: true
|
80
|
-
Include:
|
81
|
-
- 'spec/controllers/**/*'
|
82
|
-
|
83
|
-
RSpec/ExpectChange:
|
84
|
-
EnforcedStyle: block
|
85
|
-
|
86
|
-
RSpec/ImplicitSubject:
|
87
|
-
Enabled: false
|
88
|
-
|
89
|
-
RSpec/MessageSpies:
|
90
|
-
Enabled: false
|
91
|
-
|
92
|
-
RSpec/NamedSubject:
|
93
|
-
Enabled: false
|
94
|
-
|
95
|
-
RSpec/NestedGroups:
|
96
|
-
Enabled: false
|
97
|
-
|
98
|
-
RSpec/NotToNot:
|
99
|
-
EnforcedStyle: to_not
|
100
|
-
|
101
|
-
Style/AndOr:
|
102
|
-
EnforcedStyle: conditionals
|
103
|
-
|
104
|
-
Style/BlockDelimiters:
|
105
|
-
EnforcedStyle: semantic
|
106
|
-
AllowBracesOnProceduralOneLiners: true
|
107
|
-
|
108
|
-
Style/MultilineBlockChain:
|
109
|
-
Enabled: false
|
110
|
-
|
111
|
-
Style/RescueModifier:
|
112
|
-
Enabled: false
|
113
|
-
|
114
|
-
Style/TrailingCommaInArrayLiteral:
|
115
|
-
EnforcedStyleForMultiline: comma
|
116
|
-
|
117
|
-
Style/TrailingCommaInHashLiteral:
|
118
|
-
EnforcedStyleForMultiline: comma
|
119
|
-
|
120
|
-
Metrics:
|
121
|
-
Enabled: false
|
122
|
-
|
123
|
-
Style/DoubleNegation:
|
124
|
-
Enabled: false
|
data/netsoft-rubocop.gemspec
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'netsoft/rubocop/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |spec|
|
8
|
-
spec.name = 'netsoft-rubocop'
|
9
|
-
spec.version = Netsoft::Rubocop::VERSION
|
10
|
-
spec.authors = ['Alex Yarotsky']
|
11
|
-
spec.email = ['alex.yarotsky@hubstaff.com']
|
12
|
-
|
13
|
-
spec.summary = 'Hubstaff style guides and shared style configs.'
|
14
|
-
spec.homepage = 'https://github.com/netsoftHoldings/netsoft-rubocop'
|
15
|
-
|
16
|
-
# Specify which files should be added to the gem when it is released.
|
17
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
end
|
21
|
-
spec.bindir = 'exe'
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = %w[lib]
|
24
|
-
|
25
|
-
spec.add_development_dependency 'bundler', '~> 1.15'
|
26
|
-
spec.add_development_dependency 'rake', '~> 12.0'
|
27
|
-
|
28
|
-
spec.add_runtime_dependency 'rubocop', '~> 0.74.0'
|
29
|
-
spec.add_runtime_dependency 'rubocop-performance', '~> 1.4'
|
30
|
-
spec.add_runtime_dependency 'rubocop-rails', '~> 2.2'
|
31
|
-
spec.add_runtime_dependency 'rubocop-rspec', '~> 1.35'
|
32
|
-
end
|