rubocop-bridgetown 0.2.4 → 0.3.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
2
  SHA256:
3
- metadata.gz: 47a7b3f0ef1f2e3211f32ba505d5cf60310a94f9b881c11eaad81b8d17f5edfd
4
- data.tar.gz: c2c83c60b7487e5c87d289a1e5de1627311435987c1946cf2a6ff3d0c3d6dabc
3
+ metadata.gz: fb6d3e6825f1929dbfed46f7be399fc2703f7fdeaa437650f86646c39bddbf7d
4
+ data.tar.gz: 18cc1d2c1f61d8e9ab22ffa73cffba0ba6662d2d6afcba4adaf06058971414b7
5
5
  SHA512:
6
- metadata.gz: e664f288e51eb4b1075a3e95d05f15151dc2c347b069933c5f5272a305d6bdbebd35f83800e9d2d2c5cb63135eda5e23551eb53243276a18484bfaec597c7e05
7
- data.tar.gz: 23fe76f8cebf17e0a17f037f6817324c110bf9be907991eb1f1a5d24075599fa045e06adc4dca3301db813197821610cb2bc4b7cfafa72f9ec43eb11c581f753
6
+ metadata.gz: 6bd13f4ea333ae0b881448aa38cbecff5bd28573f861dacb0b72d717e33b362dd81d9f47dbffaa86f5af33cbcc0b4bd07ac49e9b84aa1ed9ab81fc566a7a1c16
7
+ data.tar.gz: 25e09c13f71fd2bc278c56b1cec585fd9f209436b153060cc2a4e1c498a8467d7b244b81772977ff0dbc7e49b0018dfc1f143a88e251fffcbb4f7939d27844ae
data/.rubocop.yml CHANGED
@@ -3,6 +3,8 @@ require:
3
3
 
4
4
  AllCops:
5
5
  TargetRubyVersion: 2.5
6
+ NewCops: enable
7
+ SuggestExtensions: false
6
8
  Exclude:
7
9
  - bin/**/*
8
10
  - exe/**/*
@@ -12,35 +14,31 @@ AllCops:
12
14
  - vendor/**/*
13
15
  - tmp/**/*
14
16
 
15
- Layout/HashAlignment:
16
- EnforcedHashRocketStyle: table
17
- Layout/IndentationWidth:
17
+ Layout/EmptyComment:
18
+ Enabled: false
19
+ Layout/EndAlignment:
18
20
  Severity: error
19
21
  Layout/FirstArrayElementIndentation:
20
22
  EnforcedStyle: consistent
21
23
  Layout/FirstHashElementIndentation:
22
24
  EnforcedStyle: consistent
25
+ Layout/HashAlignment:
26
+ EnforcedHashRocketStyle: table
27
+ Layout/IndentationWidth:
28
+ Severity: error
23
29
  Layout/MultilineMethodCallIndentation:
24
30
  EnforcedStyle: indented
25
31
  Layout/MultilineOperationIndentation:
26
32
  EnforcedStyle: indented
27
- Layout/EmptyComment:
28
- Enabled: false
29
- Layout/EndAlignment:
30
- Severity: error
31
- Lint/RaiseException:
32
- Enabled: true
33
- Lint/StructNewOverride:
34
- Enabled: true
33
+ Layout/LineLength:
34
+ Max: 100
35
+ Severity: warning
35
36
  Lint/UnreachableCode:
36
37
  Severity: error
37
38
  Metrics/AbcSize:
38
39
  Max: 24
39
40
  Metrics/ClassLength:
40
41
  Max: 240
41
- Layout/LineLength:
42
- Max: 100
43
- Severity: warning
44
42
  Metrics/MethodLength:
45
43
  CountComments: false
46
44
  Max: 20
@@ -67,37 +65,18 @@ Style/Documentation:
67
65
  Enabled: false
68
66
  Style/DoubleNegation:
69
67
  Enabled: false
70
- Style/GuardClause:
71
- Enabled: false
72
- Style/HashEachMethods:
73
- Enabled: true
74
- Style/HashSyntax: # This now adheres to GitHub's newest Ruby style guide
75
- EnforcedStyle: ruby19
76
- SupportedStyles:
77
- # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
78
- - ruby19
79
- # checks for hash rocket syntax for all hashes
80
- - hash_rockets
81
- # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
82
- - no_mixed_keys
83
- # enforces both ruby19 and no_mixed_keys styles
84
- - ruby19_no_mixed_keys
85
- # Force hashes that have a symbol value to use hash rockets
86
- UseHashRocketsWithSymbolValues: false
87
- # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
88
- PreferHashRocketsForNonAlnumEndingSymbols: false
89
- Style/HashTransformKeys:
90
- Enabled: false
91
- Style/HashTransformValues:
92
- Enabled: true
93
68
  Style/Lambda:
94
69
  EnforcedStyle: literal
95
70
  Style/LambdaCall:
96
71
  Enabled: false
97
72
  Style/ModuleFunction:
98
73
  Enabled: false
74
+ Style/MultilineBlockChain:
75
+ Enabled: false
99
76
  Style/MultilineTernaryOperator:
100
77
  Severity: error
78
+ Style/ParallelAssignment:
79
+ Enabled: false
101
80
  Style/PercentLiteralDelimiters:
102
81
  Enabled: false
103
82
  Style/RegexpLiteral:
data/README.md CHANGED
@@ -1,34 +1,27 @@
1
1
  # RuboCop Bridgetown
2
2
 
3
- A RuboCop extension to enforce common code style in Bridgetown plugins.
3
+ A RuboCop extension to enforce a common code style in the Bridgetown ecosystem and beyond.
4
4
 
5
5
  ![Gem Version](https://img.shields.io/gem/v/rubocop-bridgetown.svg?label=Latest%20Release)
6
- ![RuboCop Support](https://img.shields.io/badge/Rubocop%20Support-0.81.0-green.svg)
6
+ ![RuboCop Support](https://img.shields.io/badge/Rubocop%20Support-1.22.0-green.svg)
7
7
 
8
8
 
9
9
  ## Installation
10
10
 
11
- Just install the `rubocop-bridgetown` gem
12
-
13
- ```
14
- gem install rubocop-bridgetown
15
- ```
16
-
17
- or if you prefer Bundler, add it to your `Gemfile` or `gemspec`
11
+ Just add the `rubocop-bridgetown` gem to your Gemfile.
18
12
 
19
13
  ```ruby
20
14
  # Gemfile
21
15
 
22
- gem "rubocop-bridgetown", "~> 0.2"
16
+ gem "rubocop-bridgetown", "~> 0.3"
23
17
  ```
24
18
  ```ruby
25
19
  # <plugin>.gemspec
26
20
 
27
- spec.add_development_dependency "rubocop-bridgetown", "~> 0.2"
21
+ spec.add_development_dependency "rubocop-bridgetown", "~> 0.3"
28
22
  ```
29
23
  and run `bundle install`
30
24
 
31
-
32
25
  ## Usage
33
26
 
34
27
  You need to tell RuboCop to load the extension and *inherit* the custom RuboCop configuration advocated by
@@ -44,6 +37,16 @@ inherit_gem:
44
37
 
45
38
  Running `bundle exec rubocop` will now automatically load the `rubocop-bridgetown` cops together with the standard cops.
46
39
 
40
+ You can also add a `rubocop` task to your `Rakefile`.
41
+
42
+ ```ruby
43
+ # Rakefile
44
+
45
+ require "rubocop/rake_task"
46
+
47
+ RuboCop::RakeTask.new
48
+ ```
49
+
47
50
  ## Exclude Folders List
48
51
 
49
52
  Currently it seems Rubocop doesn't inherit the `Excludes` folder list from the gem configuration, so you may want to add it manually to your `.rubocop.yml` file:
@@ -9,7 +9,7 @@ module RuboCop
9
9
  def_node_search :p_called?, "(send _ :p _)"
10
10
 
11
11
  def on_send(node)
12
- add_offense(node, :location => :selector) if p_called?(node)
12
+ add_offense(node, location: :selector) if p_called?(node)
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module RuboCop
9
9
  def_node_search :puts_called?, "(send nil? :puts _)"
10
10
 
11
11
  def on_send(node)
12
- add_offense(node, :location => :selector) if puts_called?(node)
12
+ add_offense(node, location: :selector) if puts_called?(node)
13
13
  end
14
14
  end
15
15
  end
@@ -3,4 +3,4 @@
3
3
  require "rubocop"
4
4
 
5
5
  path_to_cops = File.join(File.expand_path("rubocop", __dir__), "cop", "**", "*.rb")
6
- Dir[path_to_cops].each { |cop| require cop }
6
+ Dir[path_to_cops].sort.each { |cop| require cop }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-bridgetown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2021-10-16 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.81.0
19
+ version: '1.22'
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.81.0
26
+ version: '1.22'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-performance
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: '1.11'
34
34
  type: :runtime
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.2'
40
+ version: '1.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement