betterlint 1.15.1 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +5 -0
- data/lib/rubocop/cop/betterment/non_standard_controller.rb +24 -0
- data/lib/rubocop/cop/betterment.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8824f5666cd34b9d8b14c60770e653721fe6f313c21a5c53d6ac3bbdd70af0d0
|
4
|
+
data.tar.gz: 50f8bedf98f9dd0f4ec57fd2a167115adb7d4c955e650b9afdbd91699fef9930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687ca7842919296a6f39eba3504ee8dd015a1837f354f11b0ffe030b1d66a9096d5d2fd516274753f3565883afbfd2df250f6a74d0da4d36db5a834df2c54ecc
|
7
|
+
data.tar.gz: 9cf4eedaac12097baf99af64d585e3ccb3b46d8ae3b5f6fda50b7b37a583b8fb3ea78528ef12fb7a904295553293b467908587aa940e972ccda055616444de69
|
data/config/default.yml
CHANGED
@@ -64,6 +64,11 @@ Betterment/NonStandardActions:
|
|
64
64
|
- update
|
65
65
|
StyleGuide: '#bettermentnonstandardactions'
|
66
66
|
|
67
|
+
Betterment/NonStandardController:
|
68
|
+
Description: Detects non-standard controller names.
|
69
|
+
Include:
|
70
|
+
- config/routes.rb
|
71
|
+
|
67
72
|
Betterment/RedirectStatus:
|
68
73
|
SafeAutoCorrect: false
|
69
74
|
Description: Detect missing status codes when redirecting POST, PUT, PATCH, or DELETE responses
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Betterment
|
6
|
+
class NonStandardController < RuboCop::Cop::Base
|
7
|
+
MSG = <<~END.gsub(/\s+/, " ")
|
8
|
+
`resources` and `resource` should not need to specify a `controller` option.
|
9
|
+
If your controller lives in a module, please use the `module` option. Otherwise,
|
10
|
+
please rename your controller to match your routes.
|
11
|
+
END
|
12
|
+
|
13
|
+
# @!method resources_with_controller(node)
|
14
|
+
def_node_matcher :resources_with_controller, <<~PATTERN
|
15
|
+
(send _ {:resources | :resource} _ (hash <$(pair (sym :controller) _) ...>))
|
16
|
+
PATTERN
|
17
|
+
|
18
|
+
def on_send(node)
|
19
|
+
resources_with_controller(node) { |option| add_offense(option) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -13,6 +13,7 @@ require 'rubocop/cop/betterment/timeout'
|
|
13
13
|
require 'rubocop/cop/betterment/internals_protection'
|
14
14
|
require 'rubocop/cop/betterment/memoization_with_arguments'
|
15
15
|
require 'rubocop/cop/betterment/non_standard_actions'
|
16
|
+
require 'rubocop/cop/betterment/non_standard_controller'
|
16
17
|
require 'rubocop/cop/betterment/site_prism_loaded'
|
17
18
|
require 'rubocop/cop/betterment/spec_helper_required_outside_spec_dir'
|
18
19
|
require 'rubocop/cop/betterment/implicit_redirect_type'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betterlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Development
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/rubocop/cop/betterment/internals_protection.rb
|
117
117
|
- lib/rubocop/cop/betterment/memoization_with_arguments.rb
|
118
118
|
- lib/rubocop/cop/betterment/non_standard_actions.rb
|
119
|
+
- lib/rubocop/cop/betterment/non_standard_controller.rb
|
119
120
|
- lib/rubocop/cop/betterment/redirect_status.rb
|
120
121
|
- lib/rubocop/cop/betterment/render_status.rb
|
121
122
|
- lib/rubocop/cop/betterment/server_error_assertion.rb
|
@@ -134,10 +135,10 @@ licenses:
|
|
134
135
|
- MIT
|
135
136
|
metadata:
|
136
137
|
homepage_uri: https://github.com/Betterment/betterlint
|
137
|
-
source_code_uri: https://github.com/Betterment/betterlint/tree/v1.
|
138
|
-
changelog_uri: https://github.com/Betterment/betterlint/blob/v1.
|
138
|
+
source_code_uri: https://github.com/Betterment/betterlint/tree/v1.16.0
|
139
|
+
changelog_uri: https://github.com/Betterment/betterlint/blob/v1.16.0/CHANGELOG.md
|
139
140
|
bug_tracker_uri: https://github.com/Betterment/betterlint/issues
|
140
|
-
documentation_uri: https://www.rubydoc.info/gems/betterlint/1.
|
141
|
+
documentation_uri: https://www.rubydoc.info/gems/betterlint/1.16.0
|
141
142
|
rubygems_mfa_required: 'true'
|
142
143
|
post_install_message:
|
143
144
|
rdoc_options: []
|
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
155
|
- !ruby/object:Gem::Version
|
155
156
|
version: '0'
|
156
157
|
requirements: []
|
157
|
-
rubygems_version: 3.5.
|
158
|
+
rubygems_version: 3.5.23
|
158
159
|
signing_key:
|
159
160
|
specification_version: 4
|
160
161
|
summary: Betterment rubocop configuration
|