polleverywhere-cops 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +9 -0
- data/TODO.md +5 -0
- data/lib/polleverywhere-cops.rb +1 -0
- data/lib/rubocop/cop/polleverywhere/constantize.rb +21 -0
- data/lib/rubocop/cop/polleverywhere/nullable_boolean.rb +1 -1
- data/lib/rubocop/polleverywhere/version.rb +1 -1
- data/polleverywhere-cops.gemspec +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b6628dcdc0949ab8a9a4c961e344b535069f610
|
4
|
+
data.tar.gz: 0f91e16f0da73b121b83b11c091720156592e158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e0208d41d0f39cb125cebfec70724d2d47db9e229df366335a433c43b5fe788c460dfcaf10eb827cbdcaf70a1ead9bb5fec7480e1f21a35ccc7265ee378c279
|
7
|
+
data.tar.gz: a827b5bbe9930667bc197666c5b0352b7a6e160cb286a083a3b3a6a59499b919567b189b716b537fb7b474c1e2d89212b7b06ce777dfacb7809fe750f96a71d0
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -5,6 +5,7 @@ Custom RuboCop cops for Poll Everywhere
|
|
5
5
|
## Cops
|
6
6
|
|
7
7
|
- *NullableBoolean*: Boolean database columns cannot be nullable.
|
8
|
+
- _Constantize_: Don't call String#constantize.
|
8
9
|
|
9
10
|
## Instructions
|
10
11
|
|
@@ -20,3 +21,11 @@ Add to `.rubocop.yml`:
|
|
20
21
|
require:
|
21
22
|
- polleverywhere-cops
|
22
23
|
```
|
24
|
+
|
25
|
+
## Publishing to RubyGems
|
26
|
+
|
27
|
+
```
|
28
|
+
$EDITOR lib/rubocop/polleverywhere/version.rb
|
29
|
+
gem build polleverywhere-cops.gemspec
|
30
|
+
gem push polleverywhere-cops-x.x.x.gem
|
31
|
+
```
|
data/TODO.md
ADDED
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 Constantize < Cop
|
7
|
+
MSG = 'The use of `constantize` is a potential security risk.'.freeze
|
8
|
+
|
9
|
+
def_node_matcher :constantize?, <<-PATTERN
|
10
|
+
(send (...) :constantize)
|
11
|
+
PATTERN
|
12
|
+
|
13
|
+
def on_send(node)
|
14
|
+
return unless constantize?(node)
|
15
|
+
|
16
|
+
add_offense(node, location: :selector)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/polleverywhere-cops.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polleverywhere-cops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Poll Everywhere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.51.0
|
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.
|
26
|
+
version: 0.51.0
|
27
27
|
description: Custom RuboCop cops for Poll Everywhere
|
28
28
|
email:
|
29
29
|
- geeks@polleverywhere.com
|
@@ -33,9 +33,12 @@ extra_rdoc_files:
|
|
33
33
|
- README.md
|
34
34
|
files:
|
35
35
|
- ".gitignore"
|
36
|
+
- CHANGELOG.md
|
36
37
|
- LICENSE
|
37
38
|
- README.md
|
39
|
+
- TODO.md
|
38
40
|
- lib/polleverywhere-cops.rb
|
41
|
+
- lib/rubocop/cop/polleverywhere/constantize.rb
|
39
42
|
- lib/rubocop/cop/polleverywhere/nullable_boolean.rb
|
40
43
|
- lib/rubocop/polleverywhere/version.rb
|
41
44
|
- polleverywhere-cops.gemspec
|
@@ -61,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
64
|
version: '0'
|
62
65
|
requirements: []
|
63
66
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.6.
|
67
|
+
rubygems_version: 2.6.14
|
65
68
|
signing_key:
|
66
69
|
specification_version: 4
|
67
70
|
summary: Custom RuboCop cops for Poll Everywhere
|