rubocop-bridgetown 0.2.2 → 0.3.1

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: d2cf6be785fdccacc37c7109664f28e0e42092fa3aa3feae743757cf7938a688
4
- data.tar.gz: 49267146654881c7fc6dcd9bd6882eeaea10a4cf2a43591f375750db742bb2dc
3
+ metadata.gz: 4ec87759e555a6191f4de65e7f3cf725e3df2f08dd81fb5096bf5af9297b438b
4
+ data.tar.gz: 7cc362169a91281eb49422e8922cc95eca7328993a6ec35e598354ca8fd5fe9f
5
5
  SHA512:
6
- metadata.gz: d7bf172273a46ec6d709fed8f948249f85a5c690c8f707b3d3f56c4f351024fddf8e6f1b0109ebef423f86f82cbdf96b730f3fb460888a19bb7f2815cfe594d2
7
- data.tar.gz: bc6db52c2b3d5771edce16ef7a119ab2ccaeb003871d70806352ca53c54932be7541853d79ec396b2618f088f85f04b27b79dcc4eac7d09aa6e7833d858b564b
6
+ metadata.gz: bd67d509bebb98f3cd7477473f559a306d6a67e137caf7564e8bf80a42e62344144771befec7a562905a697703c64e9bc290b22cac95a0cc0c8c13f882098cc0
7
+ data.tar.gz: 9101b7e6c9cd77cc25d31210e6c0a27e84e372f5f952a9e09e2eae407b3605cccad70b904d0825cd86d6a23b34ac797e520a9cc2c19c4fe8ef5b5a0f553119d7
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
@@ -61,48 +59,28 @@ Style/Alias:
61
59
  EnforcedStyle: prefer_alias_method
62
60
  Style/AndOr:
63
61
  Severity: error
62
+ Style/ClassAndModuleChildren:
63
+ Enabled: false
64
64
  Style/FrozenStringLiteralComment:
65
65
  EnforcedStyle: always
66
66
  Style/Documentation:
67
67
  Enabled: false
68
68
  Style/DoubleNegation:
69
69
  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:
70
+ Style/Lambda:
71
+ EnforcedStyle: literal
72
+ Style/LambdaCall:
90
73
  Enabled: false
91
- Style/HashTransformValues:
92
- Enabled: true
93
74
  Style/ModuleFunction:
94
75
  Enabled: false
76
+ Style/MultilineBlockChain:
77
+ Enabled: false
95
78
  Style/MultilineTernaryOperator:
96
79
  Severity: error
80
+ Style/ParallelAssignment:
81
+ Enabled: false
97
82
  Style/PercentLiteralDelimiters:
98
- PreferredDelimiters:
99
- "%q": "{}"
100
- "%Q": "{}"
101
- "%r": "!!"
102
- "%s": "()"
103
- "%w": "()"
104
- "%W": "()"
105
- "%x": "()"
83
+ Enabled: false
106
84
  Style/RegexpLiteral:
107
85
  EnforcedStyle: percent_r
108
86
  Style/RescueModifier:
@@ -114,7 +92,7 @@ Style/StringLiterals:
114
92
  Style/StringLiteralsInInterpolation:
115
93
  EnforcedStyle: double_quotes
116
94
  Style/SymbolArray:
117
- EnforcedStyle: brackets
95
+ Enabled: false
118
96
  Style/TrailingCommaInArrayLiteral:
119
97
  EnforcedStyleForMultiline: consistent_comma
120
98
  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"
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:
@@ -63,12 +66,3 @@ AllCops:
63
66
  ## Customization
64
67
 
65
68
  You can override any settings inherited from the extension by subsequently redefining the concerned parameters.
66
-
67
- ## Release Cycle
68
-
69
- 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):
70
-
71
- 1. RuboCop releases a new version.
72
- 2. The `master` branch of Bridgetown repository is updated to the latest RuboCop version along with any updates to their `.rubocop.yml`.
73
- 3. The RuboCop version and `.rubocop.yml` at this gem's repository is updated **via a pull request**.
74
- 4. A new minor release is subsequently cut and shipped.
@@ -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.2
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-12 00:00:00.000000000 Z
11
+ date: 2021-12-13 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.23'
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.23'
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.12'
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.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -83,7 +83,7 @@ homepage: https://github.com/bridgetownrb/rubocop-bridgetown
83
83
  licenses:
84
84
  - MIT
85
85
  metadata: {}
86
- post_install_message:
86
+ post_install_message:
87
87
  rdoc_options: []
88
88
  require_paths:
89
89
  - lib
@@ -98,8 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.2.0
102
- signing_key:
101
+ rubygems_version: 3.1.4
102
+ signing_key:
103
103
  specification_version: 4
104
104
  summary: Code style check for Bridgetown plugins
105
105
  test_files: []