puppet-lint-absolute_classname-check 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTAyNGNkZWJlN2YwOTM3MTQzNDhjNjEyZWEzOTQ1MjJmM2JhZTNkZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWU2M2E0MjdmNzZhMTZjOWUzM2FkMDcxMTJiY2I1NWViMmE4NjcxNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGYzYTY5YTRkODE0ZTRkYmExYmQzZjlmOTNiNDRlNjM1ZWMyOTUzMjc1MGJk
|
10
|
+
OTNlZjE4YjFmZWMxM2Q1MDdmZjFhMTAyNTgzMWRlNDRjZmRlM2Y5MTc5MzI5
|
11
|
+
ODY2ZGJjZjM1ZmY5MGVmMjRhY2M3ZTNiMGE4ZDdjMmE2ZTJiOGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmJhOTc0OTlhNGIxY2IxMDRlYTdhMGFlNzkxZmVjMzRkYzQ5NzliNTYzZWE1
|
14
|
+
NDFjNDY5YmMwYjkyMWJiNjA0OTdjM2JmMzg5MGZhN2QxMjAyNzU1YzNiY2E4
|
15
|
+
ZDkxOWY2NTU3NWYxYmZkYzg4NDA0YzI1YmYwOTRkMGY0OWZjYzE=
|
data/README.md
CHANGED
@@ -1,13 +1,28 @@
|
|
1
1
|
puppet-lint-absolute_classname-check
|
2
|
-
|
2
|
+
====================================
|
3
3
|
|
4
|
-
[![Build Status](https://
|
5
|
-
[![
|
6
|
-
[![Gem
|
7
|
-
[![Coverage Status](https://img.shields.io/coveralls/
|
4
|
+
[![Build Status](https://img.shields.io/travis/puppet-community/puppet-lint-absolute_classname-check.svg)](https://travis-ci.org/puppet-community/puppet-lint-absolute_classname-check)
|
5
|
+
[![Gem Version](https://img.shields.io/gem/v/puppet-lint-absolute_classname-check.svg)](https://rubygems.org/gems/puppet-lint-absolute_classname-check)
|
6
|
+
[![Gem Downloads](https://img.shields.io/gem/dt/puppet-lint-absolute_classname-check.svg)](https://rubygems.org/gems/puppet-lint-absolute_classname-check)
|
7
|
+
[![Coverage Status](https://img.shields.io/coveralls/puppet-community/puppet-lint-absolute_classname-check.svg)](https://coveralls.io/r/puppet-community/puppet-lint-absolute_classname-check?branch=master)
|
8
|
+
[![Gemnasium](https://img.shields.io/gemnasium/puppet-community/puppet-lint-absolute_classname-check.svg)](https://gemnasium.com/puppet-community/puppet-lint-absolute_classname-check)
|
9
|
+
[![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)
|
8
10
|
|
9
11
|
A puppet-lint plugin to check that classes are included by their absolute name.
|
10
12
|
|
13
|
+
## Installing
|
14
|
+
|
15
|
+
### From the command line
|
16
|
+
|
17
|
+
```shell
|
18
|
+
$ gem install puppet-lint-absolute_classname-check
|
19
|
+
```
|
20
|
+
|
21
|
+
### In a Gemfile
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'puppet-lint-absolute_classname-check', :require => false
|
25
|
+
```
|
11
26
|
|
12
27
|
## Checks
|
13
28
|
|
@@ -40,3 +55,11 @@ Alternatively, if you’re calling puppet-lint via the Rake task, you should ins
|
|
40
55
|
```ruby
|
41
56
|
PuppetLint.configuration.send('disable_absolute_classname')
|
42
57
|
```
|
58
|
+
|
59
|
+
## Transfer Notice
|
60
|
+
|
61
|
+
This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
|
62
|
+
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
|
63
|
+
Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.
|
64
|
+
|
65
|
+
Previously: https://github.com/camptocamp/puppet-lint-absolute_classname-check
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PuppetLint.new_check(:relative_classname_inclusion) do
|
2
2
|
def check
|
3
3
|
tokens.each_with_index do |token, token_idx|
|
4
|
-
if token.type == :NAME && token.value
|
4
|
+
if token.type == :NAME && ['include','contain','require'].include?(token.value)
|
5
5
|
s = token.next_code_token
|
6
6
|
in_function = 0
|
7
7
|
while s.type != :NEWLINE
|
@@ -19,6 +19,16 @@ describe 'relative_classname_inclusion' do
|
|
19
19
|
|
20
20
|
class foobar {
|
21
21
|
}
|
22
|
+
|
23
|
+
contain ::foobar
|
24
|
+
contain('::foobar')
|
25
|
+
contain(foobar(baz))
|
26
|
+
contain(foobar('baz'))
|
27
|
+
|
28
|
+
require ::foobar
|
29
|
+
require('::foobar')
|
30
|
+
require(foobar(baz))
|
31
|
+
require(foobar('baz'))
|
22
32
|
EOS
|
23
33
|
end
|
24
34
|
|
@@ -33,17 +43,25 @@ describe 'relative_classname_inclusion' do
|
|
33
43
|
include foobar
|
34
44
|
include(foobar)
|
35
45
|
class { 'foobar': }
|
46
|
+
contain foobar
|
47
|
+
contain(foobar)
|
48
|
+
require foobar
|
49
|
+
require(foobar)
|
36
50
|
EOS
|
37
51
|
end
|
38
52
|
|
39
|
-
it 'should detect
|
40
|
-
expect(problems).to have(
|
53
|
+
it 'should detect 7 problems' do
|
54
|
+
expect(problems).to have(7).problems
|
41
55
|
end
|
42
56
|
|
43
57
|
it 'should create warnings' do
|
44
58
|
expect(problems).to contain_warning(msg).on_line(1).in_column(17)
|
45
59
|
expect(problems).to contain_warning(msg).on_line(2).in_column(17)
|
46
60
|
expect(problems).to contain_warning(msg).on_line(3).in_column(17)
|
61
|
+
expect(problems).to contain_warning(msg).on_line(4).in_column(17)
|
62
|
+
expect(problems).to contain_warning(msg).on_line(5).in_column(17)
|
63
|
+
expect(problems).to contain_warning(msg).on_line(6).in_column(17)
|
64
|
+
expect(problems).to contain_warning(msg).on_line(7).in_column(17)
|
47
65
|
end
|
48
66
|
end
|
49
67
|
end
|
@@ -72,6 +90,16 @@ describe 'relative_classname_inclusion' do
|
|
72
90
|
|
73
91
|
class foobar {
|
74
92
|
}
|
93
|
+
|
94
|
+
contain ::foobar
|
95
|
+
contain('::foobar')
|
96
|
+
contain(foobar(baz))
|
97
|
+
contain(foobar('baz'))
|
98
|
+
|
99
|
+
require ::foobar
|
100
|
+
require('::foobar')
|
101
|
+
require(foobar(baz))
|
102
|
+
require(foobar('baz'))
|
75
103
|
EOS
|
76
104
|
end
|
77
105
|
|
@@ -86,17 +114,25 @@ describe 'relative_classname_inclusion' do
|
|
86
114
|
include foobar
|
87
115
|
include(foobar)
|
88
116
|
class { 'foobar': }
|
117
|
+
contain foobar
|
118
|
+
contain(foobar)
|
119
|
+
require foobar
|
120
|
+
require(foobar)
|
89
121
|
EOS
|
90
122
|
end
|
91
123
|
|
92
|
-
it 'should detect
|
93
|
-
expect(problems).to have(
|
124
|
+
it 'should detect 7 problems' do
|
125
|
+
expect(problems).to have(7).problems
|
94
126
|
end
|
95
127
|
|
96
128
|
it 'should fix the problems' do
|
97
129
|
expect(problems).to contain_fixed(msg).on_line(1).in_column(17)
|
98
130
|
expect(problems).to contain_fixed(msg).on_line(2).in_column(17)
|
99
131
|
expect(problems).to contain_fixed(msg).on_line(3).in_column(17)
|
132
|
+
expect(problems).to contain_fixed(msg).on_line(4).in_column(17)
|
133
|
+
expect(problems).to contain_fixed(msg).on_line(5).in_column(17)
|
134
|
+
expect(problems).to contain_fixed(msg).on_line(6).in_column(17)
|
135
|
+
expect(problems).to contain_fixed(msg).on_line(7).in_column(17)
|
100
136
|
end
|
101
137
|
|
102
138
|
it 'should should add colons' do
|
@@ -105,6 +141,10 @@ describe 'relative_classname_inclusion' do
|
|
105
141
|
include ::foobar
|
106
142
|
include(::foobar)
|
107
143
|
class { '::foobar': }
|
144
|
+
contain ::foobar
|
145
|
+
contain(::foobar)
|
146
|
+
require ::foobar
|
147
|
+
require(::foobar)
|
108
148
|
EOS
|
109
149
|
)
|
110
150
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-absolute_classname-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Puppet Community
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.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: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '10.5'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '10.5'
|
111
111
|
description: ! ' A puppet-lint plugin to check that classes are included by their
|
112
112
|
absolute name.
|
113
113
|
|
@@ -122,7 +122,7 @@ files:
|
|
122
122
|
- lib/puppet-lint/plugins/check_absolute_classname.rb
|
123
123
|
- spec/puppet-lint/plugins/check_absolute_classname/relative_classname_inclusion_spec.rb
|
124
124
|
- spec/spec_helper.rb
|
125
|
-
homepage: https://github.com/
|
125
|
+
homepage: https://github.com/puppet-community/puppet-lint-absolute_classname-check
|
126
126
|
licenses:
|
127
127
|
- Apache-2.0
|
128
128
|
metadata: {}
|