jets-rubocop 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +9 -0
- data/config/base.yml +43 -0
- data/config/rspec.yml +41 -0
- data/lib/jets-rubocop.rb +3 -0
- data/lib/jets/rubocop.rb +14 -0
- data/lib/jets/rubocop/cop/lint_env.rb +35 -0
- metadata +202 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3af88e7d47e711c183c6e140cf6b05b07c1ce1642edf001c1fffb1a3b766e434
|
4
|
+
data.tar.gz: c27b7c7d8e8219d638633e0954771dab9f43846fa0e41903ac005ca1039fb33c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a935acd3d99145922767cfb280de59f3f3dc1d203c23b39b5c013148ee652409952eb2fa361846c6ffe28a9dadbc5b2eb4e6961f05275f1141619033b7176ec6
|
7
|
+
data.tar.gz: 190c3a2eb1acdd8c392a03e06c7bac3bea027dd000c1997fb67126bdbd273f0e7aee3c7c739ca497c34235c5dd950957dfb1a9eea5f30a2ca4b466c138acbab1
|
data/Rakefile
ADDED
data/config/base.yml
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
inherit_from: "./rspec.yml"
|
2
|
+
|
3
|
+
require:
|
4
|
+
- jets/rubocop
|
5
|
+
- rubocop-rails
|
6
|
+
- rubocop-performance
|
7
|
+
- standard/cop/semantic_blocks
|
8
|
+
|
9
|
+
inherit_gem:
|
10
|
+
standard: config/base.yml
|
11
|
+
|
12
|
+
AllCops:
|
13
|
+
TargetRubyVersion: 2.7
|
14
|
+
Exclude:
|
15
|
+
- 'bin/*'
|
16
|
+
- 'tmp/**/*'
|
17
|
+
- 'node_modules/**/*'
|
18
|
+
- 'vendor/**/*'
|
19
|
+
DisplayCopNames: true
|
20
|
+
|
21
|
+
Style/FrozenStringLiteralComment:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
Standard/SemanticBlocks:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Lint/UselessAssignment:
|
28
|
+
Exclude:
|
29
|
+
- 'spec/**/*.rb'
|
30
|
+
- 'test/**/*.rb'
|
31
|
+
|
32
|
+
Lint/AmbiguousBlockAssociation:
|
33
|
+
Exclude:
|
34
|
+
- 'spec/**/*.rb'
|
35
|
+
- 'test/**/*.rb'
|
36
|
+
|
37
|
+
Rails/Output:
|
38
|
+
Enabled: true
|
39
|
+
Exclude:
|
40
|
+
- 'lib/tasks/**/*'
|
41
|
+
|
42
|
+
Gemspec/OrderedDependencies:
|
43
|
+
Enabled: true
|
data/config/rspec.yml
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
4
|
+
RSpec/Focus:
|
5
|
+
Enabled: true
|
6
|
+
|
7
|
+
RSpec/EmptyExampleGroup:
|
8
|
+
Enabled: true
|
9
|
+
CustomIncludeMethods:
|
10
|
+
- succeed
|
11
|
+
- failed
|
12
|
+
|
13
|
+
RSpec/EmptyLineAfterExampleGroup:
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
RSpec/EmptyLineAfterFinalLet:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
RSpec/EmptyLineAfterHook:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
RSpec/EmptyLineAfterSubject:
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
RSpec/HooksBeforeExamples:
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
RSpec/ImplicitExpect:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
RSpec/IteratedExpectation:
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
RSpec/LetBeforeExamples:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
RSpec/MissingExampleGroupArgument:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
RSpec/ReceiveCounts:
|
41
|
+
Enabled: true
|
data/lib/jets-rubocop.rb
ADDED
data/lib/jets/rubocop.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubocop"
|
4
|
+
require "standard"
|
5
|
+
|
6
|
+
module Jets
|
7
|
+
module Rubocop
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# Do not use the root app RuboCop exclusions in
|
12
|
+
# isolated gems stored in the same repo
|
13
|
+
# See https://github.com/rubocop-hq/rubocop/pull/4329
|
14
|
+
RuboCop::ConfigLoader.ignore_parent_exclusion = true
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubocop/rspec/language"
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
module Cop
|
7
|
+
module Lint
|
8
|
+
# This cops checks for direct usage of ENV variables and
|
9
|
+
# Rails.env
|
10
|
+
class Env < RuboCop::Cop::Cop
|
11
|
+
MSG_ENV = "Avoid direct usage of ENV in application code"
|
12
|
+
MSG_RAILS_ENV = "Avoid direct usage of Rails.env in application code"
|
13
|
+
USAGE_MSG = ", use configuration parameters instead"
|
14
|
+
|
15
|
+
def_node_matcher :env?, <<~PATTERN
|
16
|
+
{(const nil? :ENV) (const (cbase) :ENV)}
|
17
|
+
PATTERN
|
18
|
+
|
19
|
+
def_node_matcher :rails_env?, <<~PATTERN
|
20
|
+
(send {(const nil? :Rails) (const (cbase) :Rails)} :env)
|
21
|
+
PATTERN
|
22
|
+
|
23
|
+
def on_const(node)
|
24
|
+
return unless env?(node)
|
25
|
+
add_offense(node.parent, location: :selector, message: MSG_ENV + USAGE_MSG)
|
26
|
+
end
|
27
|
+
|
28
|
+
def on_send(node)
|
29
|
+
return unless rails_env?(node)
|
30
|
+
add_offense(node.parent, location: :selector, message: MSG_RAILS_ENV + USAGE_MSG)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jets-rubocop
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lauri Jutila
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-11-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubocop-rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.41'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.41'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: standard
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.3.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.3.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.13'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.13'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.6'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.6'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.9'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.9'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fuubar
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.5'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.5'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec-instafail
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rspec_junit_formatter
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.4'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.4'
|
167
|
+
description: RuboCop plugins and configuration for Jets
|
168
|
+
email: ruby@laurijutila.com
|
169
|
+
executables: []
|
170
|
+
extensions: []
|
171
|
+
extra_rdoc_files: []
|
172
|
+
files:
|
173
|
+
- Rakefile
|
174
|
+
- config/base.yml
|
175
|
+
- config/rspec.yml
|
176
|
+
- lib/jets-rubocop.rb
|
177
|
+
- lib/jets/rubocop.rb
|
178
|
+
- lib/jets/rubocop/cop/lint_env.rb
|
179
|
+
homepage: https://github.com/getjets/jets-rubocop
|
180
|
+
licenses:
|
181
|
+
- MIT
|
182
|
+
metadata: {}
|
183
|
+
post_install_message:
|
184
|
+
rdoc_options: []
|
185
|
+
require_paths:
|
186
|
+
- lib
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
requirements: []
|
198
|
+
rubygems_version: 3.1.2
|
199
|
+
signing_key:
|
200
|
+
specification_version: 4
|
201
|
+
summary: RuboCop plugins and configuration for Jets
|
202
|
+
test_files: []
|