rubocop-petal 0.9.0 → 1.0.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 +4 -4
- data/README.md +11 -3
- data/config/base.yml +108 -0
- data/lib/rubocop/cop/grape/unnecessary_namespace.rb +2 -2
- data/lib/rubocop/petal/version.rb +1 -1
- data/lib/rubocop/petal.rb +1 -2
- metadata +36 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d59a2d5781acf6465d3b1f5fef4575af1db1da8fd4af2d4ec3b0af863139cb2
|
|
4
|
+
data.tar.gz: aa4221534a285b746c8dd195347ab93c27954762bdd26f93242c712c8cbed20f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81707e3d93a3e10e36dcdd299c63f804b8b820a8406b267715c084ed8fd5b0180633ea2e2a335623df414e3251959813332526d1e796fe86771241af85c09920
|
|
7
|
+
data.tar.gz: '048bde3d8f343cb218b2bd25dbbedbd30fc8ff7579028e3a6f3d805800c7212720b7fc48e4b8757dd9948c5775730f27287490b18dc701d15e893800a7c73562'
|
data/README.md
CHANGED
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
Petal custom cops. List of cops can be find [here](https://github.com/petalmd/rubocop-petal/tree/main/lib/rubocop/cop).
|
|
7
7
|
|
|
8
|
+
Petal global cops configuration for:
|
|
9
|
+
|
|
10
|
+
* rubocop
|
|
11
|
+
* rubocop-rspec
|
|
12
|
+
* rubocop-performance
|
|
13
|
+
* rubocop-rails
|
|
14
|
+
* rubocop-petal
|
|
15
|
+
|
|
8
16
|
## Installation
|
|
9
17
|
|
|
10
18
|
Add this line to your application's Gemfile:
|
|
@@ -23,11 +31,11 @@ Or install it yourself as:
|
|
|
23
31
|
|
|
24
32
|
## Usage
|
|
25
33
|
|
|
26
|
-
In your `.rubocop.yml` file, add
|
|
34
|
+
In your `.rubocop.yml` file, add
|
|
27
35
|
|
|
28
36
|
```yaml
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
inherit_gem:
|
|
38
|
+
rubocop-petal: 'config/base.yml'
|
|
31
39
|
```
|
|
32
40
|
|
|
33
41
|
## Development
|
data/config/base.yml
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-rails
|
|
3
|
+
- rubocop-performance
|
|
4
|
+
- rubocop-rspec
|
|
5
|
+
- rubocop-petal
|
|
6
|
+
|
|
7
|
+
AllCops:
|
|
8
|
+
SuggestExtensions: false
|
|
9
|
+
DisplayCopNames: true
|
|
10
|
+
NewCops: enable
|
|
11
|
+
DisplayStyleGuide: true
|
|
12
|
+
ExtraDetails: true
|
|
13
|
+
StyleGuideBaseURL: https://rubystyle.guide
|
|
14
|
+
Layout/CaseIndentation:
|
|
15
|
+
IndentOneStep: true
|
|
16
|
+
Layout/MultilineAssignmentLayout:
|
|
17
|
+
SupportedTypes:
|
|
18
|
+
- case
|
|
19
|
+
- if
|
|
20
|
+
Layout/MultilineMethodCallIndentation:
|
|
21
|
+
EnforcedStyle: indented
|
|
22
|
+
IndentationWidth: 2
|
|
23
|
+
Layout/MultilineArrayLineBreaks:
|
|
24
|
+
Enabled: true
|
|
25
|
+
Layout/MultilineHashKeyLineBreaks:
|
|
26
|
+
Enabled: true
|
|
27
|
+
Layout/MultilineMethodArgumentLineBreaks:
|
|
28
|
+
Enabled: true
|
|
29
|
+
Lint/AmbiguousBlockAssociation:
|
|
30
|
+
Exclude:
|
|
31
|
+
- spec/**/*
|
|
32
|
+
Metrics/AbcSize:
|
|
33
|
+
Max: 20
|
|
34
|
+
Metrics/BlockLength:
|
|
35
|
+
Enabled: false
|
|
36
|
+
Metrics/BlockNesting:
|
|
37
|
+
Enabled: false
|
|
38
|
+
Metrics/ClassLength:
|
|
39
|
+
Enabled: false
|
|
40
|
+
Metrics/CyclomaticComplexity:
|
|
41
|
+
Max: 10
|
|
42
|
+
Metrics/MethodLength:
|
|
43
|
+
Enabled: false
|
|
44
|
+
Metrics/ModuleLength:
|
|
45
|
+
Enabled: false
|
|
46
|
+
Metrics/PerceivedComplexity:
|
|
47
|
+
Max: 12
|
|
48
|
+
RSpec:
|
|
49
|
+
StyleGuideBaseURL: https://rspec.rubystyle.guide
|
|
50
|
+
RSpec/ContextWording:
|
|
51
|
+
Prefixes:
|
|
52
|
+
- when
|
|
53
|
+
- with
|
|
54
|
+
- without
|
|
55
|
+
- if
|
|
56
|
+
- unless
|
|
57
|
+
- for
|
|
58
|
+
RSpec/ExampleLength:
|
|
59
|
+
Enabled: false
|
|
60
|
+
RSpec/ExampleWithoutDescription:
|
|
61
|
+
EnforcedStyle: single_line_only
|
|
62
|
+
RSpec/HookArgument:
|
|
63
|
+
Enabled: false
|
|
64
|
+
RSpec/LetSetup:
|
|
65
|
+
Enabled: false
|
|
66
|
+
RSpec/MessageSpies:
|
|
67
|
+
EnforcedStyle: receive
|
|
68
|
+
RSpec/MultipleExpectations:
|
|
69
|
+
Enabled: false
|
|
70
|
+
RSpec/MultipleMemoizedHelpers:
|
|
71
|
+
Enabled: false
|
|
72
|
+
RSpec/NamedSubject:
|
|
73
|
+
Enabled: false
|
|
74
|
+
RSpec/NestedGroups:
|
|
75
|
+
Max: 5
|
|
76
|
+
RSpec/PredicateMatcher:
|
|
77
|
+
Enabled: false
|
|
78
|
+
RSpec/StubbedMock:
|
|
79
|
+
Enabled: false
|
|
80
|
+
RSpec/DescribeClass:
|
|
81
|
+
Exclude:
|
|
82
|
+
- spec/integration/**/*.rb
|
|
83
|
+
Rails/SaveBang:
|
|
84
|
+
Enabled: true
|
|
85
|
+
Rails/NotNullColumn:
|
|
86
|
+
Enabled: false
|
|
87
|
+
Rails/UnknownEnv:
|
|
88
|
+
Environments:
|
|
89
|
+
- production
|
|
90
|
+
- development
|
|
91
|
+
- test
|
|
92
|
+
- staging
|
|
93
|
+
Rails/WhereExists:
|
|
94
|
+
Enabled: false
|
|
95
|
+
Style/CollectionMethods:
|
|
96
|
+
PreferredMethods:
|
|
97
|
+
detect: detect
|
|
98
|
+
collect: map
|
|
99
|
+
Style/DateTime:
|
|
100
|
+
Enabled: true
|
|
101
|
+
Style/Documentation:
|
|
102
|
+
Enabled: false
|
|
103
|
+
Style/FrozenStringLiteralComment:
|
|
104
|
+
EnforcedStyle: always_true
|
|
105
|
+
Style/NumericLiterals:
|
|
106
|
+
MinDigits: 8
|
|
107
|
+
Style/ReturnNil:
|
|
108
|
+
Enabled: true
|
|
@@ -14,7 +14,7 @@ module RuboCop
|
|
|
14
14
|
# get :some_path {}
|
|
15
15
|
#
|
|
16
16
|
class UnnecessaryNamespace < Base
|
|
17
|
-
MSG = 'Unnecessary usage of Grape namespace. '\
|
|
17
|
+
MSG = 'Unnecessary usage of Grape namespace. ' \
|
|
18
18
|
'Specify endpoint name with an argument: `get :some_path`.'
|
|
19
19
|
HTTP_ACTIONS = Set.new(%i[get head put post patch delete])
|
|
20
20
|
GRAPE_NAMESPACE_ALIAS = Set.new(%i[namespace resource resources])
|
|
@@ -50,7 +50,7 @@ module RuboCop
|
|
|
50
50
|
return if http_action_node.size != 1
|
|
51
51
|
|
|
52
52
|
paths = paths_added_with_http_action(http_action_node.first)
|
|
53
|
-
add_offense(node) if paths.
|
|
53
|
+
add_offense(node) if paths.empty?
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
private
|
data/lib/rubocop/petal.rb
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
require_relative 'petal/version'
|
|
4
4
|
|
|
5
5
|
module RuboCop
|
|
6
|
-
module Petal
|
|
6
|
+
module Petal
|
|
7
7
|
class Error < StandardError; end
|
|
8
|
-
# Your code goes here...
|
|
9
8
|
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
|
10
9
|
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
|
11
10
|
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
metadata
CHANGED
|
@@ -1,49 +1,71 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-petal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean-Francis Bastien
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-05-
|
|
11
|
+
date: 2023-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 1.7.0
|
|
20
|
-
- - "<"
|
|
17
|
+
- - "~>"
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
19
|
+
version: 1.50.0
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
|
-
- - "
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 1.50.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rubocop-performance
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
28
32
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 1.
|
|
30
|
-
|
|
33
|
+
version: 1.17.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
31
39
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
40
|
+
version: 1.17.0
|
|
33
41
|
- !ruby/object:Gem::Dependency
|
|
34
42
|
name: rubocop-rails
|
|
35
43
|
requirement: !ruby/object:Gem::Requirement
|
|
36
44
|
requirements:
|
|
37
45
|
- - "~>"
|
|
38
46
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '2.
|
|
47
|
+
version: '2.19'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '2.19'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rubocop-rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 2.17.0
|
|
40
62
|
type: :runtime
|
|
41
63
|
prerelease: false
|
|
42
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
65
|
requirements:
|
|
44
66
|
- - "~>"
|
|
45
67
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
68
|
+
version: 2.17.0
|
|
47
69
|
description:
|
|
48
70
|
email:
|
|
49
71
|
- jfbastien@petalmd.com
|
|
@@ -55,6 +77,7 @@ extra_rdoc_files:
|
|
|
55
77
|
files:
|
|
56
78
|
- LICENSE.txt
|
|
57
79
|
- README.md
|
|
80
|
+
- config/base.yml
|
|
58
81
|
- config/default.yml
|
|
59
82
|
- lib/rubocop-petal.rb
|
|
60
83
|
- lib/rubocop/cop/chewy/reset_on_type.rb
|