puppet-lint-absolute_classname-check 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWFlMTZkOGE3NDQ2YTBhNTEzZmFmMWM2YTRmNTQ1ZjRiOTgzNTUzYw==
5
- data.tar.gz: !binary |-
6
- YmM5MDcwNjFhOTNjNmQ3NTczYThkZmRkZTE4Y2IwZTE3Y2IwODczYw==
2
+ SHA256:
3
+ metadata.gz: a4532e4c27bf29b9453d7eec0a3f4c8422a67fa96df7860ed9da6e3ebf563064
4
+ data.tar.gz: 3682dba2b87f038de61698113b4613f2920e7aea24df9b1b8668d7c67dc50c14
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YmQ0ZDU3MGU4Y2JlY2E5OTZmMzhmNDg0MWE5ZjZmMDVjNGQzMDEzOGJkMTZm
10
- ZjkxNWZhM2IzY2ZjNzQ3OGNkYjk0ZGUyODUwYjc0YjJhN2I3MDVlZmQ4ZDVh
11
- MjkxNGFjMTM1MjhjNmUyODdmZmMxZGE5YzM2YTliZjllMjdkNDE=
12
- data.tar.gz: !binary |-
13
- NzcwMWVmODk1NzE4Y2NlZTQ4ODY0YWFlNTBhZDExZDlkMjA5NWZkYmFkYWI0
14
- MGQxOWU5NWEzZDA1YTU1Njc2MDk2ZDQ0NGVhZGE4MTZjYzczMTRlOWQzN2Fm
15
- MmE5MDU5YmFjOTc1MWZhZmJhOTc2NmU0YThhNTAwZDI3OWJhM2Q=
6
+ metadata.gz: 361e65365e7e9b00825a6fb4008b98c049b611d662aef04991211f0df1f6ba02fab47cfd954ff39ca80778c6d66c39126c4b5cb4d1315aae052b1aad86a3c11e
7
+ data.tar.gz: 1dbf8a874f4c5e6f29ed49e587ee5a6e0ed0db80822b52a8d6d67d7c334dc0fd4842061e645f128233449ee4702f1aaf4f814db0f5d035e6f92e1fa17ddb838c
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  puppet-lint-absolute_classname-check
2
2
  ====================================
3
3
 
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)
4
+ [![Build Status](https://img.shields.io/travis/voxpupuli/puppet-lint-absolute_classname-check.svg)](https://travis-ci.org/voxpupuli/puppet-lint-absolute_classname-check)
5
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
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)
7
+ [![Coverage Status](https://img.shields.io/coveralls/voxpupuli/puppet-lint-absolute_classname-check.svg)](https://coveralls.io/r/voxpupuli/puppet-lint-absolute_classname-check?branch=master)
8
+ [![Gemnasium](https://img.shields.io/gemnasium/voxpupuli/puppet-lint-absolute_classname-check.svg)](https://gemnasium.com/voxpupuli/puppet-lint-absolute_classname-check)
9
9
  [![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)
10
10
 
11
11
  A puppet-lint plugin to check that classes are included by their absolute name.
@@ -28,7 +28,7 @@ gem 'puppet-lint-absolute_classname-check', :require => false
28
28
 
29
29
  ### Relative class name inclusion
30
30
 
31
- Including a class by a relative name might lead to unexpected results.
31
+ Including a class by a relative name might lead to unexpected results [in Puppet 3](https://docs.puppet.com/puppet/3/lang_namespaces.html#relative-name-lookup-and-incorrect-name-resolution). This plugin is **not** recommended for use with Puppet code that has dropped support for Puppet 3 (EOL 20161231).
32
32
 
33
33
  #### What you have done
34
34
 
@@ -44,16 +44,16 @@ include ::foobar
44
44
 
45
45
  #### Disabling the check
46
46
 
47
- To disable this check, you can add `--no-absolute_classname-check` to your puppet-lint command line.
47
+ To disable this check, you can add `--no-relative_classname_inclusion-check` to your puppet-lint command line.
48
48
 
49
49
  ```shell
50
- $ puppet-lint --no-absolute_classname-check path/to/file.pp
50
+ $ puppet-lint --no-relative_classname_inclusion-check path/to/file.pp
51
51
  ```
52
52
 
53
53
  Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your `Rakefile`.
54
54
 
55
55
  ```ruby
56
- PuppetLint.configuration.send('disable_absolute_classname')
56
+ PuppetLint.configuration.send('disable_relative_classname_inclusion')
57
57
  ```
58
58
 
59
59
  ## Transfer Notice
@@ -1,13 +1,14 @@
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 && ['include','contain','require'].include?(token.value)
4
+ if [:NAME,:FUNCTION_NAME].include?(token.type) && ['include','contain','require'].include?(token.value)
5
5
  s = token.next_code_token
6
+ next if s.nil?
6
7
  next if s.type == :FARROW
7
8
  in_function = 0
8
9
  while s.type != :NEWLINE
9
10
  n = s.next_code_token
10
- if s.type == :NAME || s.type == :SSTRING
11
+ if [:NAME, :FUNCTION_NAME, :SSTRING,].include?(s.type)
11
12
  if n && n.type == :LPAREN
12
13
  in_function += 1
13
14
  elsif in_function > 0 && n && n.type == :RPAREN
@@ -182,4 +182,18 @@ describe 'relative_classname_inclusion' do
182
182
  end
183
183
  end
184
184
  end
185
+
186
+ describe '(#12) behavior of lookup("foo", {merge => unique}).include' do
187
+ let(:msg) { '(#12) class included with lookup("foo", {merge => unique}).include' }
188
+
189
+ let(:code) do
190
+ <<-EOS
191
+ lookup(foo, {merge => unique}).include
192
+ EOS
193
+ end
194
+
195
+ it 'should not detect any problems' do
196
+ expect(problems).to have(0).problems
197
+ end
198
+ end
185
199
  end
metadata CHANGED
@@ -1,124 +1,122 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-absolute_classname-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
- - Puppet Community
7
+ - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.0'
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: rspec
34
+ name: coveralls
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '3.0'
39
+ version: '0'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ~>
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '3.0'
46
+ version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: rspec-its
48
+ name: mime-types
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '1.0'
53
+ version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: '1.0'
60
+ version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: rspec-collection_matchers
62
+ name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '1.0'
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '1.0'
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: mime-types
76
+ name: rspec
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: '1.0'
81
+ version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: '1.0'
88
+ version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: coveralls
90
+ name: rspec-collection_matchers
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ~>
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '0.7'
95
+ version: '0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ~>
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '0.7'
102
+ version: '0'
103
103
  - !ruby/object:Gem::Dependency
104
- name: rake
104
+ name: rspec-its
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ~>
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '10.5'
109
+ version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ~>
115
- - !ruby/object:Gem::Version
116
- version: '10.5'
117
- description: ! ' A puppet-lint plugin to check that classes are included by their
118
- absolute name.
119
-
120
- '
121
- email: raphael.pinson@camptocamp.com
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ description: |2
118
+ A puppet-lint plugin to check that classes are included by their absolute name.
119
+ email: voxpupuli@groups.io
122
120
  executables: []
123
121
  extensions: []
124
122
  extra_rdoc_files: []
@@ -128,7 +126,7 @@ files:
128
126
  - lib/puppet-lint/plugins/check_absolute_classname.rb
129
127
  - spec/puppet-lint/plugins/check_absolute_classname/relative_classname_inclusion_spec.rb
130
128
  - spec/spec_helper.rb
131
- homepage: https://github.com/puppet-community/puppet-lint-absolute_classname-check
129
+ homepage: https://github.com/voxpupuli/puppet-lint-absolute_classname-check
132
130
  licenses:
133
131
  - Apache-2.0
134
132
  metadata: {}
@@ -138,17 +136,17 @@ require_paths:
138
136
  - lib
139
137
  required_ruby_version: !ruby/object:Gem::Requirement
140
138
  requirements:
141
- - - ! '>='
139
+ - - ">="
142
140
  - !ruby/object:Gem::Version
143
141
  version: '0'
144
142
  required_rubygems_version: !ruby/object:Gem::Requirement
145
143
  requirements:
146
- - - ! '>='
144
+ - - ">="
147
145
  - !ruby/object:Gem::Version
148
146
  version: '0'
149
147
  requirements: []
150
148
  rubyforge_project:
151
- rubygems_version: 2.4.5
149
+ rubygems_version: 2.7.3
152
150
  signing_key:
153
151
  specification_version: 4
154
152
  summary: A puppet-lint plugin to check that classes are included by their absolute