rubocop-elegant 0.7.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caefc6549542af9deff3c876e4f5820c45b1641a0006d797c05776123675a3d2
4
- data.tar.gz: 59a23203e472ff8485a69e714f3085efa6a5a323381097f4fedb104df5363238
3
+ metadata.gz: 49e44073640a27652772c3b1930072896e3fa04d47f81ec741a3f1941f9dcaca
4
+ data.tar.gz: 9d4de768ab46f9246ac3bf5554501e9c3472a821563cd3022a21a15be6f4e728
5
5
  SHA512:
6
- metadata.gz: 553939a2d42896140b0b778faa879bdf4729a5411a60c22013b66313173d2b2785d5c7052bf68baf8ec2b223d450de7707393a73aa7a0a47bfa970283ae388ab
7
- data.tar.gz: 8dbae33a180941efead52d5ed739f0f1ee349947769790d322a8ece2e224169ef79179fed362383f508bd05d5ab27b84935e3a552028b04a132c0077a3ee2a28
6
+ metadata.gz: 60d73b3d6db72f172ecdf0950670221938cb2c08fb88a4f70183db7b324a8d31f5ad0e03d71502cae60df24dc24aaa12e53a805f44ac914117c49cd48df74fa6
7
+ data.tar.gz: 81c6c3e3bb185c60ebe83b82dc810325ab8dd5b93ea17b2853ff73dc20f0664296cdad793e369652a6947a38bba63dc945cfcf35cfc37d51622b81e5582add9f
data/config/default.yml CHANGED
@@ -103,6 +103,8 @@ Layout/EndOfLine:
103
103
  EnforcedStyle: lf
104
104
  Layout/ParameterAlignment:
105
105
  Enabled: false
106
+ Layout/ArrayAlignment:
107
+ EnforcedStyle: with_fixed_indentation
106
108
  Layout/LineLength:
107
109
  Max: 120
108
110
  Style/MultilineBlockChain:
@@ -18,11 +18,16 @@ class RuboCop::Cop::Elegant::GoodMethodName < RuboCop::Cop::Base
18
18
  private
19
19
 
20
20
  def check(node, name)
21
+ return unless identifier?(name)
21
22
  return if allowed?(name)
22
23
  return if match?(name)
23
24
  add_offense(node, message: format(MSG, name: name))
24
25
  end
25
26
 
27
+ def identifier?(name)
28
+ /\A[a-zA-Z_]/.match?(name)
29
+ end
30
+
26
31
  def match?(name)
27
32
  pattern.match?(name)
28
33
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
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.7.0'
12
+ s.version = '0.7.1'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Set of custom RuboCop cops for elegant Ruby coding'
15
15
  s.description =
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.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko