rubocop-bridgetown 0.2.1 → 0.3.0

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: 11a1f8d566ad6962a16c7c1f2e87e1ee1a87b0569147636eca24b650e9a65b2b
4
- data.tar.gz: 688bb6290ab6d2c443cbc7e33a692b428d17717a178849668db1c345e02546c4
3
+ metadata.gz: fb6d3e6825f1929dbfed46f7be399fc2703f7fdeaa437650f86646c39bddbf7d
4
+ data.tar.gz: 18cc1d2c1f61d8e9ab22ffa73cffba0ba6662d2d6afcba4adaf06058971414b7
5
5
  SHA512:
6
- metadata.gz: 4a0d668b99ad86771d7ea7a740d22d35ff9cb3661f42adbba7161a35936ea03f4fad21c58a08fd5d2661aae8b1b7fd757252dbb3001a61a800ac65e4100d6288
7
- data.tar.gz: 49d8e45ba882157533e61ea7c0cf7fcfa2c76abc229ffb6da779d10e1c4d644c149094f93fe0274cda9d72ab50f0ec3426cd3e45bc13421899c3ed2d8cf18815
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,42 +65,20 @@ 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:
68
+ Style/Lambda:
69
+ EnforcedStyle: literal
70
+ Style/LambdaCall:
90
71
  Enabled: false
91
- Style/HashTransformValues:
92
- Enabled: true
93
72
  Style/ModuleFunction:
94
73
  Enabled: false
74
+ Style/MultilineBlockChain:
75
+ Enabled: false
95
76
  Style/MultilineTernaryOperator:
96
77
  Severity: error
78
+ Style/ParallelAssignment:
79
+ Enabled: false
97
80
  Style/PercentLiteralDelimiters:
98
- PreferredDelimiters:
99
- "%q": "{}"
100
- "%Q": "{}"
101
- "%r": "!!"
102
- "%s": "()"
103
- "%w": "()"
104
- "%W": "()"
105
- "%x": "()"
81
+ Enabled: false
106
82
  Style/RegexpLiteral:
107
83
  EnforcedStyle: percent_r
108
84
  Style/RescueModifier:
@@ -114,7 +90,7 @@ Style/StringLiterals:
114
90
  Style/StringLiteralsInInterpolation:
115
91
  EnforcedStyle: double_quotes
116
92
  Style/SymbolArray:
117
- EnforcedStyle: brackets
93
+ Enabled: false
118
94
  Style/TrailingCommaInArrayLiteral:
119
95
  EnforcedStyleForMultiline: consistent_comma
120
96
  Style/TrailingCommaInHashLiteral:
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.0"
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.0"
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,17 +37,32 @@ 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`.
47
41
 
48
- ## Customization
42
+ ```ruby
43
+ # Rakefile
49
44
 
50
- You can override any settings inherited from the extension by subsequently redefining the concerned parameters.
45
+ require "rubocop/rake_task"
51
46
 
47
+ RuboCop::RakeTask.new
48
+ ```
49
+
50
+ ## Exclude Folders List
52
51
 
53
- ## Release Cycle
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:
54
53
 
55
- A new release of this gem is manually cut based on the adoption of the latest version of RuboCop by the [Bridgetown repository](https://github.com/bridgetownrb/bridgetown):
54
+ ```yaml
55
+ AllCops:
56
+ Exclude:
57
+ - bin/**/*
58
+ - exe/**/*
59
+ - benchmark/**/*
60
+ - node_modules/**/*
61
+ - script/**/*
62
+ - vendor/**/*
63
+ - tmp/**/*
64
+ ```
56
65
 
57
- 1. RuboCop releases a new version.
58
- 2. The `master` branch of Bridgetown repository is updated to the latest RuboCop version along with any updates to their `.rubocop.yml`.
59
- 3. The RuboCop version and `.rubocop.yml` at this gem's repository is updated **via a pull request**.
60
- 4. A new minor release is subsequently cut and shipped.
66
+ ## Customization
67
+
68
+ You can override any settings inherited from the extension by subsequently redefining the concerned parameters.
@@ -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
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rubocop"
4
+
3
5
  path_to_cops = File.join(File.expand_path("rubocop", __dir__), "cop", "**", "*.rb")
4
- 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.1
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: 2020-12-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