polleverywhere-cops 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/polleverywhere-cops.rb +1 -0
- data/lib/rubocop/cop/polleverywhere/render_views.rb +21 -0
- data/lib/rubocop/polleverywhere/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7913672b2b360707923e231046ee3eede74a07fe
|
4
|
+
data.tar.gz: 94779a03f3ca7d87a23dcf0001b3911925120c93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13bfdb335a3c9f6decb4aaafb7eebc0bbb2b5fcd16f6daec2556dac79fbb26fede8797eab3f9ca3398132cc20abe05b67908c2e9deec855a867d9291e81f11f2
|
7
|
+
data.tar.gz: 782401cd2d8262c2b1fd9102f6947e5f63a49e481b84419aeee520457061d78570efdf35759d5354e13e3a0e840adfd311bf40ff78451aa4d8b94d3973af5a15
|
data/README.md
CHANGED
@@ -4,8 +4,9 @@ Custom RuboCop cops for Poll Everywhere
|
|
4
4
|
|
5
5
|
## Cops
|
6
6
|
|
7
|
-
-
|
7
|
+
- _NullableBoolean_: Boolean database columns cannot be nullable.
|
8
8
|
- _Constantize_: Don't call String#constantize.
|
9
|
+
- _RenderViews_: Don't call `render_views` in controller specs.
|
9
10
|
|
10
11
|
## Instructions
|
11
12
|
|
data/lib/polleverywhere-cops.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module PollEverywhere
|
6
|
+
class RenderViews < Cop
|
7
|
+
MSG = 'Do not use `render_views` in controller tests because it is an order of magnitude slower. If view rendering needs to be tested, write a different type of test.'.freeze
|
8
|
+
|
9
|
+
def_node_matcher :render_views?, <<-PATTERN
|
10
|
+
(send nil? :render_views)
|
11
|
+
PATTERN
|
12
|
+
|
13
|
+
def on_send(node)
|
14
|
+
return unless render_views?(node)
|
15
|
+
|
16
|
+
add_offense(node, location: :selector)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polleverywhere-cops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Poll Everywhere
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- lib/polleverywhere-cops.rb
|
41
41
|
- lib/rubocop/cop/polleverywhere/constantize.rb
|
42
42
|
- lib/rubocop/cop/polleverywhere/nullable_boolean.rb
|
43
|
+
- lib/rubocop/cop/polleverywhere/render_views.rb
|
43
44
|
- lib/rubocop/polleverywhere/version.rb
|
44
45
|
- polleverywhere-cops.gemspec
|
45
46
|
homepage: https://github.com/polleverywhere/polleverywhere-cops
|