rubocop-elegant 0.0.8 → 0.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0539949abeb53317287379d9fd13d4c2f672aefe830d40b8075e62c5550cda76'
4
- data.tar.gz: 890fa74b0264add82bee3d266420625e4e95c5b79109c5b61b35b7babbee8a56
3
+ metadata.gz: 3217f34ead6ad0b67f7a26e1161f02a95348516568d7f6e7854f55868851d61c
4
+ data.tar.gz: 85731d9b53196da18194c638ca619470b560ef07618d5ba3c31ebbedfa80c874
5
5
  SHA512:
6
- metadata.gz: 24621f1ff1a81e8ef550e61c0aa8126658a2a087afea620428850ffd554ab7e525efd1aae365967e351cf3930ce7baeaf952b13994a2b3e171722fa89d2f7383
7
- data.tar.gz: a2bde4c190887c1572c5c4500c3eb8c2f4bd5b11002dd8cce9f3931169ff4b611f413152ed90887fdb8514e766051fa59a40a662a0b4fe6aa5d572258a2f470a
6
+ metadata.gz: a893c8544575191d84d47bf8e44e6f109ca63858b2ec08410a298d81a3ccf9bcde4f2deafe70d03f299895e15a6e45c02bdf7c4daa55be505ca632aa6bcd6940
7
+ data.tar.gz: 6eb5a8ac49772f0a1d11d314ce438cbadfb6cb31f567dc453d96d3820d306d1b45376bc9b471d999ead56340796bf12b6cc09d064ae1067404bcfc630057dbf1
data/README.md CHANGED
@@ -25,14 +25,21 @@ First, install it:
25
25
  gem install rubocop-elegant
26
26
  ```
27
27
 
28
- Then, add it to your `.rubocop.yml`:
28
+ Then, format your `.rubocop.yml` like this:
29
29
 
30
30
  ```yaml
31
+ AllCops:
32
+ EnabledByDefault: true
33
+ NewCops: enable
31
34
  plugins:
32
- - rubocop-elegant
35
+ - rubocop-minitest
36
+ - rubocop-performance
37
+ - rubocop-rake
38
+ - rubocop-elegant # must be the last one
33
39
  ```
34
40
 
35
- Should work.
41
+ The `rubocop-elegant` not only provides its own cops, but also configures
42
+ default ones the "right" way.
36
43
 
37
44
  ## How to contribute
38
45
 
data/config/default.yml CHANGED
@@ -41,8 +41,6 @@ Naming/FileName:
41
41
  Regex: '^[a-z0-9\-._]*$'
42
42
  Minitest/EmptyLineBeforeAssertionMethods:
43
43
  Enabled: false
44
- Layout/EmptyLineAfterGuardClause:
45
- Enabled: false
46
44
  Layout/RescueEnsureAlignment:
47
45
  Enabled: false
48
46
  Layout/MultilineMethodCallIndentation:
@@ -93,3 +91,37 @@ Metrics/CyclomaticComplexity:
93
91
  Max: 15
94
92
  Metrics/PerceivedComplexity:
95
93
  Max: 15
94
+ Lint/ConstantResolution:
95
+ Enabled: false
96
+ Style/IpAddresses:
97
+ Enabled: false
98
+ Minitest/NoAssertions:
99
+ Enabled: false
100
+ Layout/EmptyLineAfterGuardClause:
101
+ Enabled: false
102
+ Bundler/GemComment:
103
+ Enabled: false
104
+ Style/DocumentationMethod:
105
+ Enabled: false
106
+ Style/MissingElse:
107
+ Enabled: false
108
+ Style/MethodCalledOnDoEndBlock:
109
+ Enabled: false
110
+ Style/StringHashKeys:
111
+ Enabled: false
112
+ Style/HashLookupMethod:
113
+ Enabled: false
114
+ Style/MethodCallWithArgsParentheses:
115
+ Enabled: true
116
+ Layout/MultilineMethodArgumentLineBreaks:
117
+ Enabled: false
118
+ Layout/RedundantLineBreak:
119
+ Enabled: true
120
+ Performance/Casecmp:
121
+ Enabled: false
122
+ Layout/FirstMethodArgumentLineBreak:
123
+ Enabled: false
124
+ Style/ArrayFirstLast:
125
+ Enabled: false
126
+ Minitest/AssertEmptyLiteral:
127
+ Enabled: false
@@ -8,6 +8,7 @@ module RuboCop
8
8
  module Elegant
9
9
  class GoodMethodName < Base
10
10
  MSG = 'Method name "%<name>s" does not match the required pattern'
11
+ public_constant :MSG
11
12
 
12
13
  def on_def(node)
13
14
  check(node, node.method_name.to_s)
@@ -8,6 +8,7 @@ module RuboCop
8
8
  module Elegant
9
9
  class GoodVariableName < Base
10
10
  MSG = 'Variable name "%<name>s" does not match the required pattern'
11
+ public_constant :MSG
11
12
 
12
13
  def on_lvasgn(node)
13
14
  check(node, node.children.first.to_s)
@@ -10,6 +10,7 @@ module RuboCop
10
10
  extend AutoCorrector
11
11
 
12
12
  MSG = 'Comment is not allowed, unless it is SPDX, magic, or rubocop directive'
13
+ public_constant :MSG
13
14
 
14
15
  def on_new_investigation
15
16
  processed_source.comments.each do |comment|
@@ -10,6 +10,7 @@ module RuboCop
10
10
  extend AutoCorrector
11
11
 
12
12
  MSG = 'Empty line inside method body is not allowed'
13
+ public_constant :MSG
13
14
 
14
15
  def on_def(node)
15
16
  check(node)
@@ -31,7 +32,7 @@ module RuboCop
31
32
  def range(node)
32
33
  first = node.body.first_line
33
34
  last = node.body.last_line
34
- return nil if first == last
35
+ return if first == last
35
36
  (first..last)
36
37
  end
37
38
 
@@ -6,5 +6,6 @@
6
6
  module RuboCop
7
7
  module Elegant
8
8
  VERSION = '0.0.1'
9
+ public_constant :VERSION
9
10
  end
10
11
  end
@@ -6,10 +6,10 @@
6
6
  require 'English'
7
7
 
8
8
  Gem::Specification.new do |s|
9
- s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
9
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to?(:required_rubygems_version=)
10
10
  s.required_ruby_version = '>=2.2'
11
11
  s.name = 'rubocop-elegant'
12
- s.version = '0.0.8'
12
+ s.version = '0.0.10'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Set of custom RuboCop cops for elegant Ruby coding'
15
15
  s.description =
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.extra_rdoc_files = ['README.md']
23
23
  s.metadata['rubygems_mfa_required'] = 'true'
24
24
  s.metadata['default_lint_roller_plugin'] = 'RuboCop::Elegant::Plugin'
25
- s.add_dependency 'lint_roller', '~> 1.1'
26
- s.add_dependency 'rubocop', '~> 1.75'
25
+ s.add_dependency('lint_roller', '~> 1.1')
26
+ s.add_dependency('rubocop', '~> 1.75')
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-elegant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko