datarockets-style 0.9.0 → 1.2.0

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
- SHA1:
3
- metadata.gz: e242588724f25da2f7b419cdaa056a5bfaf6124f
4
- data.tar.gz: 8f9a0dee26834329998c453b204be71e8f9de398
2
+ SHA256:
3
+ metadata.gz: 16590c13f8a15d26842216bb4c0b411c9431a177b7d81b32b9e7a074257b4cf5
4
+ data.tar.gz: 440e87351bf3e6900d114650fede11f1ab68b2ba5f1d72fe6e599758fec6f346
5
5
  SHA512:
6
- metadata.gz: 2b304b6c5bf560780de884e8cbc0fbe4e9b6fbe8760284561e5b5548c281bc34122a6750c987de5a467d56ac99396f3c03ccd7e496ca5c3bd8d6d7a29f3ced32
7
- data.tar.gz: d7f847d65457edf80911a60f205697f53c410d3a59364a12899e6e1e9151d6294a7d78ae7b98006da726c44f3f69234a4e647889efc74fe08c0afcca7faef19d
6
+ metadata.gz: be32cf2f4da3c94b9e532bfd0e0a2f0d416200ebc5d2992fdb3ff223b9b9603dd4f78ff198640c4500964cda5f82b93b5484694c909371d53bea2cd185356c0a
7
+ data.tar.gz: b0120bd764544c9fe6458b981f3b5174d96eaed7980ea29b8ca4b73065b8794225ab832478ee0c7666a1b4ae13908e17d403f30351c80fdd9ec17a4ef6247d49
data/.gitignore CHANGED
@@ -4,3 +4,7 @@
4
4
  /_yardoc/
5
5
  /pkg/
6
6
  /tmp/
7
+
8
+ .byebug_history
9
+ .idea
10
+ Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -2,7 +2,74 @@
2
2
 
3
3
  The format is described in [Contributing notes](CONTRIBUTING.md#changelog-entry-format).
4
4
 
5
- ## master (unreleased)
5
+ ## master
6
+
7
+ ## 1.2.0
8
+
9
+ ### Added
10
+
11
+ * [#219](https://github.com/datarockets/datarockets-style/issues/219) Add `RSpec/PreferBeforeOverSetup` cop. ([@paydaylight][])
12
+
13
+ ### Changed
14
+
15
+ * [#233](https://github.com/datarockets/datarockets-style/issues/233) Setup `EnforcedStyleForMultiline` for `Style/TrailingCommaInArguments` and `Style/TrailingCommaInArrayLiteral` rules. ([@paydaylight][])
16
+ * [#124](https://github.com/datarockets/datarockets-style/issues/124) Move gem dependencies to `./datarockets-style.gemspec` and drop `Gemfile.lock` tracking. ([@paydaylight][])
17
+ * [#253](https://github.com/datarockets/datarockets-style/issues/253) Update rubocop to `1.10`. ([@paydaylight][])
18
+ * [#124](https://github.com/datarockets/datarockets-style/issues/124) Update rubocop-rails to `2.9`. ([@paydaylight][])
19
+
20
+ ### Fixed
21
+
22
+ * [#251](https://github.com/datarockets/datarockets-style/issues/251) Update documentation to match `1.1.0` release changes. ([@paydaylight][])
23
+
24
+ ## 1.1.0 (2021-02-09)
25
+
26
+ ### Changed
27
+
28
+ * Setup `EnforcedStyleForMultiline` for `Style/TrailingCommaInHashLiteral` rule. ([@r.dubrovsky][])
29
+ * Update rubocop to `1.9.1`. ([@paydaylight][])
30
+ * Update rubocop-rails requirement to `>= 2.8.0, < 2.10.0`. ([@paydaylight][])
31
+ * Update rubocop-rspec to `2.2.0`. ([@paydaylight][])
32
+ * Change `Datarockets::Style` module to `DatarocketsStyle`. ([@paydaylight][])
33
+
34
+ ### Fixed
35
+
36
+ * [#177](https://github.com/datarockets/datarockets-style/issues/177) set `Layout/MultilineOperationIndentation` to indented ([@paydaylight][])
37
+
38
+ ## 1.0.0 (2020-11-10)
39
+
40
+ ### Changed
41
+
42
+ * Update rubocop to `1.2.0`.
43
+ * Update rubocop-rails to `2.8.1`.
44
+ * Update rubocop-rspec tp `2.0.0`.
45
+
46
+ ## 0.11.0 (2020-11-07)
47
+
48
+ ### Changed
49
+
50
+ * Update rubocop to '0.93.1'. ([@r.dubrovsky][])
51
+ * Enable new cops `Lint/BinaryOperatorWithIdenticalOperands`, `Lint/DuplicateRescueException`, `Lint/EmptyConditionalBody`, `Lint/FloatComparison`, `Lint/MissingSuper
52
+ `, `Lint/OutOfRangeRegexpRef`, `Lint/SelfAssignment`, `Lint/TopLevelReturnWithArgument`, `Lint/UnreachableLoop`, `Style/ExplicitBlockArgument`, `Style/GlobalStdStream`, `Style/OptionalBooleanParameter`, `Style/SingleArgumentDig`, `Style/SoleNestedConditional` and `Style/StringConcatenation` in version `0.89`.
53
+ * Allow to add all new lints automatically.
54
+ * Add auto-correctable count notification.
55
+ * Fix tests
56
+ * Update rubocop-rails to `2.7.1`.
57
+ * Update rubocop-rspec tp `1.43.2`.
58
+ * Disable `RSpec/MultipleMemoizedHelpers` cop.
59
+
60
+ ## 0.10.0 (2020-07-17)
61
+
62
+ ### Changed
63
+
64
+ * Update rubocop to `0.88.0`. ([@r.dubrovsky][])
65
+ * Enable new cops `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpCharacterClass` and `Style/RedundantRegexpEscape`. Cops were added in version `0.85`.
66
+ * Enable new cop `Style/RedundantFetchBlock`. Cop was added in version `0.86`.
67
+ * Enable new cops `Style/AccessorGrouping`, `Style/BisectedAttrAccessor` and `Style/RedundantAssignment`. Cops were added in version `0.87`.
68
+ * Enable new cops `Lint/DuplicateElsifCondition`, `Style/ArrayCoercion`, `Style/CaseLikeIf`, `Style/HashAsLastArrayItem`, `Style/HashLikeCase` and `Style/RedundantFileExtensionInRequire`. Cops were added in version `0.88`.
69
+ * Update rubocop-rails to `2.6.0`.
70
+ * Update rubocop-rspec to `1.42.0`.
71
+
72
+ * Setup `no_braces` rule for `Style/HashAsLastArrayItem` cop which added in the rubocop version `0.88`.
6
73
 
7
74
  ## 0.9.0 (2020-05-27)
8
75
 
@@ -10,7 +77,7 @@ The format is described in [Contributing notes](CONTRIBUTING.md#changelog-entry-
10
77
 
11
78
  * **(Breaking)** Drop support for Ruby 2.3. ([@r.dubrovsky][])
12
79
 
13
- * Update rubocop to '0.84.0'. ([@r.dubrovsky][])
80
+ * Update rubocop to `0.84.0`. ([@r.dubrovsky][])
14
81
  * Enable new cops `Lint/RaiseException` and `Lint/StructNewOverride`. Cops were added in version `0.81`.
15
82
  * Enable new cops `Layout/SpaceAroundMethodCallOperator` and `Style/ExponentialNotation`. Cops were added in version `0.82`.
16
83
  * Enable new cops `Layout/EmptyLinesAroundAttributeAccessor` and `Style/SlicingWithRange`. Cops were added in version `0.83`.
@@ -171,4 +238,4 @@ The format is described in [Contributing notes](CONTRIBUTING.md#changelog-entry-
171
238
  [@v.kuzmik]: https://github.com/TheBlackArroVV/
172
239
  [@a.branzeanu]: https://github.com/texpert
173
240
  [@nikitasakov]: https://github.com/nikitasakov
174
-
241
+ [@paydaylight]: https://github.com/paydaylight
data/Gemfile CHANGED
@@ -3,7 +3,3 @@ source "https://rubygems.org"
3
3
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  gemspec
6
-
7
- gem "pry-byebug"
8
- gem "rake", "~> 13.0"
9
- gem "rspec", "~> 3.7"
data/README.md CHANGED
@@ -10,14 +10,14 @@ Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
12
  group :test, :development do
13
- gem 'datarockets-style'
13
+ gem 'datarockets-style', '~> 1.1.0'
14
14
  end
15
15
  ```
16
16
 
17
17
  Or, for a Ruby library, add this to your gemspec:
18
18
 
19
19
  ```ruby
20
- spec.add_development_dependency 'datarockets-style'
20
+ spec.add_development_dependency 'datarockets-style', '~> 1.1.0'
21
21
  ```
22
22
 
23
23
  And then execute:
@@ -108,28 +108,28 @@ Result of the formatter is compatible with rubocop config or rubocop todo file.
108
108
  For running that cop, just print in your command like
109
109
 
110
110
  ```bash
111
- $ bundle exec rubocop -f TodoListFormatter -r datarockets/style
111
+ $ bundle exec rubocop -f TodoListFormatter -r datarockets_style
112
112
  Inspecting 10 files
113
113
  ...CC.CC..
114
114
  10 files inspected, 7 offenses detected
115
115
 
116
116
  Layout/IndentationConsistency:
117
117
  Exclude:
118
- - 'spec/datarockets/style/formatter/todo_list_formatter_spec.rb' # 1
118
+ - 'spec/datarockets_style/formatter/todo_list_formatter_spec.rb' # 1
119
119
 
120
120
  Naming/MemoizedInstanceVariableName:
121
121
  Exclude:
122
- - 'lib/datarockets/style/formatter/todo_list_formatter/report_summary.rb' # 1
122
+ - 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb' # 1
123
123
 
124
124
  RSpec/ExampleLength:
125
125
  Exclude:
126
- - 'spec/datarockets/style/formatter/todo_list_formatter/report_summary_spec.rb' # 1
127
- - 'spec/datarockets/style/formatter/todo_list_formatter_spec.rb' # 2
126
+ - 'spec/datarockets_style/formatter/todo_list_formatter/report_summary_spec.rb' # 1
127
+ - 'spec/datarockets_style/formatter/todo_list_formatter_spec.rb' # 2
128
128
 
129
129
  Style/Documentation:
130
130
  Exclude:
131
- - 'lib/datarockets/style/formatter/todo_list_formatter/report_summary.rb' # 1
132
- - 'lib/datarockets/style/formatter/todo_list_formatter.rb' # 1
131
+ - 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb' # 1
132
+ - 'lib/datarockets_style/formatter/todo_list_formatter.rb' # 1
133
133
  ```
134
134
 
135
135
  #### Autocorrection
@@ -137,24 +137,24 @@ Style/Documentation:
137
137
  If you run the formatter with autocorrection options, the formatter skip corrected cop and does not include it to the result.
138
138
 
139
139
  ```bash
140
- $ bundle exec rubocop -f TodoListFormatter -r datarockets/style -a
140
+ $ bundle exec rubocop -f TodoListFormatter -r datarockets_style -a
141
141
  Inspecting 10 files
142
142
  ...CC.CC..
143
143
  10 files inspected, 7 offenses detected, 1 offenses corrected
144
144
 
145
145
  Naming/MemoizedInstanceVariableName:
146
146
  Exclude:
147
- - 'lib/datarockets/style/formatter/todo_list_formatter/report_summary.rb' # 1
147
+ - 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb' # 1
148
148
 
149
149
  RSpec/ExampleLength:
150
150
  Exclude:
151
- - 'spec/datarockets/style/formatter/todo_list_formatter/report_summary_spec.rb' # 1
152
- - 'spec/datarockets/style/formatter/todo_list_formatter_spec.rb' # 2
151
+ - 'spec/datarockets_style/formatter/todo_list_formatter/report_summary_spec.rb' # 1
152
+ - 'spec/datarockets_style/formatter/todo_list_formatter_spec.rb' # 2
153
153
 
154
154
  Style/Documentation:
155
155
  Exclude:
156
- - 'lib/datarockets/style/formatter/todo_list_formatter/report_summary.rb' # 1
157
- - 'lib/datarockets/style/formatter/todo_list_formatter.rb' # 1
156
+ - 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb' # 1
157
+ - 'lib/datarockets_style/formatter/todo_list_formatter.rb' # 1
158
158
  ```
159
159
 
160
160
  ## Non-goals of RuboCop
@@ -178,4 +178,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
178
178
 
179
179
  ## Code of Conduct
180
180
 
181
- Everyone interacting in the Datarockets::Style project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
181
+ Everyone interacting in the DatarocketsStyle project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
data/RELEASING.md CHANGED
@@ -15,3 +15,19 @@ gem push *built_file*
15
15
  * Announce the new release,
16
16
  making sure to say "thank you" to the contributors
17
17
  who helped shape this version!
18
+
19
+ ## Versioning stragety
20
+
21
+ As versioning strategy, we're using SemVer: `MAJOR.MINOR.PATCH`
22
+
23
+ A `MAJOR` version must be incremented if there are any backward-incompatible breaking changes included in a release. This has the benefit of making it easy for anyone to quickly identify if a new version will work differently than a previous one.
24
+
25
+ Usually, we'll increment it on updating major versions of rubocop dependencies. Ideally, it should be synchronized with the major verion of `rubocop`.
26
+
27
+ The `MINOR` version must be incremented if backward-compatible functionality is introduced. In the strictest sense, this means you should be able to upgrade to a new minor version without experiencing any breaking changes.
28
+
29
+ Usually, we'll increment it on changing the list of cops, updating minor versions of dependencies.
30
+
31
+ The `PATCH` version is meant for backward-compatible bug fixes. You should expect no new functionality with a new patch version, only improvements.
32
+
33
+ Usually, we'll use it for updating patch versions of dependencies or fixing bugs of the last version. Changed rules of cops in most cases should be added to minor version.
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "datarockets/style"
4
+ require "datarockets_style"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
data/config/base.yml CHANGED
@@ -1,4 +1,7 @@
1
- require: datarockets/style
1
+ require: datarockets_style
2
+
3
+ AllCops:
4
+ NewCops: enable
2
5
 
3
6
  Bundler/DuplicatedGem:
4
7
  Enabled: true
@@ -47,6 +50,9 @@ Layout/FirstHashElementIndentation:
47
50
  Layout/MultilineMethodCallIndentation:
48
51
  EnforcedStyle: indented
49
52
 
53
+ Layout/MultilineOperationIndentation:
54
+ EnforcedStyle: indented
55
+
50
56
  Layout/SpaceAroundMethodCallOperator:
51
57
  Enabled: true
52
58
 
@@ -54,33 +60,91 @@ Layout/SpaceInsideHashLiteralBraces:
54
60
  EnforcedStyle: no_space
55
61
  EnforcedStyleForEmptyBraces: no_space
56
62
 
63
+ Lint/BinaryOperatorWithIdenticalOperands:
64
+ Enabled: true
65
+
57
66
  Lint/DeprecatedOpenSSLConstant:
58
67
  Enabled: true
59
68
 
69
+ Lint/DuplicateElsifCondition:
70
+ Enabled: true
71
+
72
+ Lint/DuplicateRescueException:
73
+ Enabled: true
74
+
75
+ Lint/EmptyConditionalBody:
76
+ Enabled: true
77
+
78
+ Lint/FloatComparison:
79
+ Enabled: true
80
+
81
+ Lint/MissingSuper:
82
+ Enabled: true
83
+
84
+ Lint/MixedRegexpCaptureTypes:
85
+ Enabled: true
86
+
87
+ Lint/OutOfRangeRegexpRef:
88
+ Enabled: true
89
+
60
90
  Lint/RaiseException:
61
91
  Enabled: true
62
92
 
93
+ Lint/SelfAssignment:
94
+ Enabled: true
95
+
63
96
  Lint/StructNewOverride:
64
97
  Enabled: true
65
98
 
99
+ Lint/TopLevelReturnWithArgument:
100
+ Enabled: true
101
+
102
+ Lint/UnreachableLoop:
103
+ Enabled: true
104
+
66
105
  Naming/MemoizedInstanceVariableName:
67
106
  EnforcedStyleForLeadingUnderscores: required
68
107
 
69
108
  Naming/RescuedExceptionsVariableName:
70
109
  PreferredName: error
71
110
 
111
+ Style/AccessorGrouping:
112
+ Enabled: true
113
+
114
+ Style/ArrayCoercion:
115
+ Enabled: true
116
+
117
+ Style/BisectedAttrAccessor:
118
+ Enabled: true
119
+
120
+ Style/CaseLikeIf:
121
+ Enabled: true
122
+
72
123
  Style/ClassAndModuleChildren:
73
124
  EnforcedStyle: nested
74
125
 
75
126
  Style/EmptyMethod:
76
127
  EnforcedStyle: expanded
77
128
 
129
+ Style/ExplicitBlockArgument:
130
+ Enabled: true
131
+
78
132
  Style/ExponentialNotation:
79
133
  Enabled: true
80
134
 
135
+ Style/GlobalStdStream:
136
+ Enabled: true
137
+
138
+ Style/HashAsLastArrayItem:
139
+ Enabled: true
140
+ EnforcedStyle: no_braces
141
+
81
142
  Style/HashEachMethods:
82
143
  Enabled: true
83
144
 
145
+ Style/HashLikeCase:
146
+ Enabled: true
147
+
84
148
  Style/HashTransformKeys:
85
149
  Enabled: true
86
150
 
@@ -93,8 +157,44 @@ Style/FrozenStringLiteralComment:
93
157
  Style/NestedInterpolation:
94
158
  Enabled: true
95
159
 
160
+ Style/OptionalBooleanParameter:
161
+ Enabled: true
162
+
163
+ Style/RedundantAssignment:
164
+ Enabled: true
165
+
166
+ Style/RedundantFetchBlock:
167
+ Enabled: true
168
+
169
+ Style/RedundantFileExtensionInRequire:
170
+ Enabled: true
171
+
172
+ Style/RedundantRegexpCharacterClass:
173
+ Enabled: true
174
+
175
+ Style/RedundantRegexpEscape:
176
+ Enabled: true
177
+
178
+ Style/SingleArgumentDig:
179
+ Enabled: true
180
+
96
181
  Style/SlicingWithRange:
97
182
  Enabled: true
98
183
 
184
+ Style/SoleNestedConditional:
185
+ Enabled: true
186
+
187
+ Style/StringConcatenation:
188
+ Enabled: true
189
+
99
190
  Style/StringLiterals:
100
191
  EnforcedStyle: double_quotes
192
+
193
+ Style/TrailingCommaInArguments:
194
+ EnforcedStyleForMultiline: comma
195
+
196
+ Style/TrailingCommaInArrayLiteral:
197
+ EnforcedStyleForMultiline: comma
198
+
199
+ Style/TrailingCommaInHashLiteral:
200
+ EnforcedStyleForMultiline: comma
data/config/rails.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  require: rubocop-rails
2
2
 
3
+ inherit_from: base.yml
4
+
3
5
  AllCops:
4
6
  Exclude:
5
7
  - "db/**/*"
@@ -12,8 +14,6 @@ AllCops:
12
14
  - "config.ru"
13
15
  - "Rakefile"
14
16
 
15
- inherit_from: base.yml
16
-
17
17
  Style/Documentation:
18
18
  Enabled: true
19
19
  Exclude:
data/config/rspec.yml CHANGED
@@ -31,5 +31,11 @@ RSpec/LetSetup:
31
31
  RSpec/MessageSpies:
32
32
  EnforcedStyle: have_received
33
33
 
34
+ RSpec/MultipleMemoizedHelpers:
35
+ Enabled: false
36
+
34
37
  RSpec/NestedGroups:
35
38
  Enabled: false
39
+
40
+ RSpec/PreferBeforeOverSetup:
41
+ Enabled: true
@@ -1,10 +1,10 @@
1
1
  lib = File.expand_path("lib", __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "datarockets/style/version"
3
+ require "datarockets_style/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "datarockets-style"
7
- spec.version = Datarockets::Style::VERSION
7
+ spec.version = DatarocketsStyle::VERSION
8
8
  spec.authors = ["Roman Dubrovsky"]
9
9
  spec.email = ["r.dubrovsky@datarockets.com"]
10
10
 
@@ -30,7 +30,11 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "rubocop", "~> 0.84"
34
- spec.add_dependency "rubocop-rails", "~> 2.5.2"
35
- spec.add_dependency "rubocop-rspec", "~> 1.39"
33
+ spec.add_dependency "rubocop", "~> 1.10"
34
+ spec.add_dependency "rubocop-rails", "~> 2.9"
35
+ spec.add_dependency "rubocop-rspec", "~> 2.0"
36
+
37
+ spec.add_development_dependency "pry-byebug"
38
+ spec.add_development_dependency "rake", "~> 13.0"
39
+ spec.add_development_dependency "rspec", "~> 3.10"
36
40
  end