puppet-ghostbuster 0.8.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +17 -0
  3. data/.github/workflows/release.yml +33 -0
  4. data/.github/workflows/test.yml +57 -0
  5. data/.gitignore +5 -4
  6. data/.rubocop.yml +8 -0
  7. data/.rubocop_todo.yml +170 -0
  8. data/CHANGELOG.md +209 -90
  9. data/Gemfile +13 -1
  10. data/README.md +15 -5
  11. data/Rakefile +31 -9
  12. data/lib/puppet-ghostbuster/puppetdb.rb +31 -8
  13. data/lib/puppet-ghostbuster/version.rb +1 -1
  14. data/lib/puppet-lint/plugins/check_ghostbuster_classes.rb +4 -4
  15. data/lib/puppet-lint/plugins/check_ghostbuster_defines.rb +5 -6
  16. data/lib/puppet-lint/plugins/check_ghostbuster_facts.rb +14 -15
  17. data/lib/puppet-lint/plugins/check_ghostbuster_files.rb +17 -20
  18. data/lib/puppet-lint/plugins/check_ghostbuster_functions.rb +8 -8
  19. data/lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb +31 -30
  20. data/lib/puppet-lint/plugins/check_ghostbuster_templates.rb +13 -10
  21. data/lib/puppet-lint/plugins/check_ghostbuster_types.rb +5 -5
  22. data/puppet-ghostbuster.gemspec +21 -19
  23. data/spec/fixtures/hiera.yaml +11 -12
  24. data/spec/fixtures/modules/foo/lib/facter/bar.rb +2 -0
  25. data/spec/fixtures/modules/foo/lib/facter/baz.rb +2 -0
  26. data/spec/fixtures/modules/foo/lib/facter/foo.rb +2 -0
  27. data/spec/fixtures/modules/foo/lib/facter/multi.rb +2 -0
  28. data/spec/fixtures/modules/foo/lib/facter/quux.rb +2 -0
  29. data/spec/fixtures/modules/foo/lib/puppet/parser/functions/bar.rb +8 -2
  30. data/spec/fixtures/modules/foo/lib/puppet/parser/functions/baz.rb +8 -2
  31. data/spec/fixtures/modules/foo/lib/puppet/parser/functions/foo.rb +8 -2
  32. data/spec/fixtures/modules/foo/lib/puppet/parser/functions/quux.rb +8 -2
  33. data/spec/fixtures/modules/foo/lib/puppet/type/bar.rb +2 -0
  34. data/spec/fixtures/modules/foo/lib/puppet/type/foo.rb +2 -0
  35. data/spec/puppet-lint/plugins/ghostbuster_classes_spec.rb +10 -9
  36. data/spec/puppet-lint/plugins/ghostbuster_defines_spec.rb +11 -11
  37. data/spec/puppet-lint/plugins/ghostbuster_facts_spec.rb +21 -20
  38. data/spec/puppet-lint/plugins/ghostbuster_files_spec.rb +25 -25
  39. data/spec/puppet-lint/plugins/ghostbuster_functions_spec.rb +16 -15
  40. data/spec/puppet-lint/plugins/ghostbuster_hiera_files_spec.rb +30 -30
  41. data/spec/puppet-lint/plugins/ghostbuster_templates_spec.rb +17 -16
  42. data/spec/puppet-lint/plugins/ghostbuster_types_spec.rb +10 -9
  43. data/spec/spec_helper.rb +45 -4
  44. metadata +78 -38
  45. data/.travis.yml +0 -20
data/CHANGELOG.md CHANGED
@@ -1,180 +1,299 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- ## [0.8.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.8.0) (2016-09-23)
4
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.3...0.8.0)
3
+ All notable changes to this project will be documented in this file.
5
4
 
6
- **Implemented enhancements:**
5
+ ## [1.1.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/1.1.0) (2024-01-08)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/1.0.0...1.1.0)
8
+
9
+ Due to problems during the migration from the camptocamp GitHub org to Vox Pupuli we had some issues with the v1.0.0 Release. The tag exists but the release isn't available on rubygems.org.
10
+
11
+ **Merged pull requests:**
12
+
13
+ - reorder gems in Gemfile/gemspec [\#78](https://github.com/voxpupuli/puppet-ghostbuster/pull/78) ([bastelfreak](https://github.com/bastelfreak))
14
+ - Set minimal Ruby version to 2.7 [\#77](https://github.com/voxpupuli/puppet-ghostbuster/pull/77) ([bastelfreak](https://github.com/bastelfreak))
15
+
16
+ ## [1.0.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/1.0.0) (2023-11-11)
17
+
18
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.9.0...1.0.0)
19
+
20
+ **Breaking changes:**
21
+
22
+ - Support hiera v5 [\#75](https://github.com/voxpupuli/puppet-ghostbuster/pull/75) ([marek130](https://github.com/marek130))
23
+
24
+ **Closed issues:**
25
+
26
+ - Can we bump this module to support puppet-lint \> 3? [\#67](https://github.com/voxpupuli/puppet-ghostbuster/issues/67)
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Bump actions/checkout from 3 to 4 [\#72](https://github.com/voxpupuli/puppet-ghostbuster/pull/72) ([dependabot[bot]](https://github.com/apps/dependabot))
31
+ - added some unsafe rubocop fixes [\#71](https://github.com/voxpupuli/puppet-ghostbuster/pull/71) ([zilchms](https://github.com/zilchms))
32
+ - Update puppet-lint requirement from \>= 1.0, \< 3.0 to \>= 1.0, \< 5.0 [\#70](https://github.com/voxpupuli/puppet-ghostbuster/pull/70) ([dependabot[bot]](https://github.com/apps/dependabot))
33
+ - modulesync 2023-8-23 [\#69](https://github.com/voxpupuli/puppet-ghostbuster/pull/69) ([zilchms](https://github.com/zilchms))
34
+ - add transfer notice to README; adjust gemspec accordingly [\#68](https://github.com/voxpupuli/puppet-ghostbuster/pull/68) ([zilchms](https://github.com/zilchms))
35
+ - Use default certificate locations [\#65](https://github.com/voxpupuli/puppet-ghostbuster/pull/65) ([raphink](https://github.com/raphink))
36
+ - typo fix in the readme file [\#64](https://github.com/voxpupuli/puppet-ghostbuster/pull/64) ([Sher-Chowdhury](https://github.com/Sher-Chowdhury))
37
+
38
+ ## [0.9.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.9.0) (2017-08-18)
7
39
 
8
- - Supports Puppet-lint 2.0.
40
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.8.0...0.9.0)
9
41
 
10
- ## [0.7.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.3) (2016-06-08)
11
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.2...0.7.3)
42
+ **Merged pull requests:**
43
+
44
+ - Use PQL [\#62](https://github.com/voxpupuli/puppet-ghostbuster/pull/62) ([raphink](https://github.com/raphink))
45
+
46
+ ## [0.8.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.8.0) (2016-09-23)
47
+
48
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.7.3...0.8.0)
49
+
50
+ **Closed issues:**
51
+
52
+ - Conflicts with puppet-lint 2 [\#61](https://github.com/voxpupuli/puppet-ghostbuster/issues/61)
53
+
54
+ ## [0.7.3](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.3) (2016-06-08)
55
+
56
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.7.2...0.7.3)
12
57
 
13
58
  **Fixed bugs:**
14
59
 
15
- - False positive when fact is boolean
60
+ - \[Hiera\_files\] False positive when fact is boolean [\#59](https://github.com/voxpupuli/puppet-ghostbuster/issues/59)
61
+
62
+ **Merged pull requests:**
63
+
64
+ - Convert fact value to boolean \(fixes \#59\) [\#60](https://github.com/voxpupuli/puppet-ghostbuster/pull/60) ([mcanevet](https://github.com/mcanevet))
16
65
 
17
- ## [0.7.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.2) (2016-05-19)
18
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.1...0.7.2)
66
+ ## [0.7.2](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.2) (2016-05-19)
67
+
68
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.7.1...0.7.2)
19
69
 
20
70
  **Fixed bugs:**
21
71
 
22
- - Detect facts used in inline_templates()
72
+ - Facts used in inline\_templates are not detected [\#53](https://github.com/voxpupuli/puppet-ghostbuster/issues/53)
23
73
 
24
- ## [0.7.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.1) (2016-05-16)
25
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.0...0.7.1)
74
+ **Merged pull requests:**
26
75
 
27
- **Implemented enhancements:**
76
+ - Detect facts used in inline\_template \(fixes \#53\) [\#54](https://github.com/voxpupuli/puppet-ghostbuster/pull/54) ([mcanevet](https://github.com/mcanevet))
77
+
78
+ ## [0.7.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.1) (2016-05-16)
79
+
80
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.7.0...0.7.1)
81
+
82
+ **Merged pull requests:**
28
83
 
29
- - Add missing documentation.
30
- - Use PuppetDB instead of manifests to detect unused types.
84
+ - Use puppetdb instead of manifests for unused types detection [\#52](https://github.com/voxpupuli/puppet-ghostbuster/pull/52) ([mcanevet](https://github.com/mcanevet))
31
85
 
32
- ## [0.7.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.0) (2016-05-16)
33
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.6.0...0.7.0)
86
+ ## [0.7.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.0) (2016-05-16)
87
+
88
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.6.0...0.7.0)
34
89
 
35
90
  **Implemented enhancements:**
36
91
 
37
- - Detect unused facts.
38
- - Detect unused functions.
39
- - Detect unused types.
92
+ - Plugin to detect unused facts [\#45](https://github.com/voxpupuli/puppet-ghostbuster/issues/45)
93
+ - Plugin to detect unused types [\#44](https://github.com/voxpupuli/puppet-ghostbuster/issues/44)
94
+ - Plugin to detect unused functions [\#43](https://github.com/voxpupuli/puppet-ghostbuster/issues/43)
95
+
96
+ **Closed issues:**
97
+
98
+ - Use fixtures for puppetdb calls [\#42](https://github.com/voxpupuli/puppet-ghostbuster/issues/42)
99
+
100
+ **Merged pull requests:**
40
101
 
41
- ## [0.6.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.6.0) (2016-05-12)
42
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.5.1...0.6.0)
102
+ - Detect unused types \(fixes \#44\) [\#51](https://github.com/voxpupuli/puppet-ghostbuster/pull/51) ([mcanevet](https://github.com/mcanevet))
103
+ - Detect unused functions \(fixes \#43\) [\#50](https://github.com/voxpupuli/puppet-ghostbuster/pull/50) ([mcanevet](https://github.com/mcanevet))
104
+ - Use fixtures for puppetdb queries [\#49](https://github.com/voxpupuli/puppet-ghostbuster/pull/49) ([mcanevet](https://github.com/mcanevet))
105
+ - Detect unused facts \(fixes \#45\) [\#46](https://github.com/voxpupuli/puppet-ghostbuster/pull/46) ([mcanevet](https://github.com/mcanevet))
106
+
107
+ ## [0.6.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.6.0) (2016-05-12)
108
+
109
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.5.1...0.6.0)
43
110
 
44
111
  **Implemented enhancements:**
45
112
 
46
- - Detect unused hiera files.
113
+ - Plugin to detect unused hiera files [\#26](https://github.com/voxpupuli/puppet-ghostbuster/issues/26)
114
+
115
+ **Merged pull requests:**
116
+
117
+ - Detect unused hiera files \(fixes \#26\) [\#48](https://github.com/voxpupuli/puppet-ghostbuster/pull/48) ([mcanevet](https://github.com/mcanevet))
47
118
 
48
- ## [0.5.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.5.1) (2016-05-11)
49
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.5.0...0.5.1)
119
+ ## [0.5.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.5.1) (2016-05-11)
120
+
121
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.5.0...0.5.1)
122
+
123
+ **Implemented enhancements:**
124
+
125
+ - Use fixtures for unit tests [\#38](https://github.com/voxpupuli/puppet-ghostbuster/issues/38)
126
+ - Detect templates included in templates [\#37](https://github.com/voxpupuli/puppet-ghostbuster/issues/37)
50
127
 
51
128
  **Fixed bugs:**
52
129
 
53
- - Detect templates included in templates
130
+ - Module path with ending slash cause an error [\#13](https://github.com/voxpupuli/puppet-ghostbuster/issues/13)
131
+
132
+ **Closed issues:**
133
+
134
+ - non-ssl fails [\#14](https://github.com/voxpupuli/puppet-ghostbuster/issues/14)
135
+
136
+ **Merged pull requests:**
137
+
138
+ - Detect templates included in templates \(Fix \#37\) [\#41](https://github.com/voxpupuli/puppet-ghostbuster/pull/41) ([mcanevet](https://github.com/mcanevet))
139
+ - Add a spec lib to ease PuppetDB mocking [\#40](https://github.com/voxpupuli/puppet-ghostbuster/pull/40) ([raphink](https://github.com/raphink))
140
+ - Use fixtures [\#39](https://github.com/voxpupuli/puppet-ghostbuster/pull/39) ([mcanevet](https://github.com/mcanevet))
141
+
142
+ ## [0.5.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.5.0) (2016-05-10)
54
143
 
55
- ## [0.5.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.5.0) (2016-05-10)
56
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.5...0.5.0)
144
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.5...0.5.0)
57
145
 
58
146
  **Implemented enhancements:**
59
147
 
60
- - Major Reimplementation. Delivered as puppet-lint plugins.
148
+ - refactor puppet db queries \(self.client\) [\#7](https://github.com/voxpupuli/puppet-ghostbuster/issues/7)
61
149
 
62
- ## [0.4.5](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.5) (2016-05-04)
63
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.4...0.4.5)
150
+ **Closed issues:**
64
151
 
65
- **Fixed bugs:**
152
+ - \[File\] False positive when parent dir has recurse =\> true [\#21](https://github.com/voxpupuli/puppet-ghostbuster/issues/21)
153
+ - Fix manifests filter regex [\#33](https://github.com/voxpupuli/puppet-ghostbuster/issues/33)
154
+ - Fix warning: class variable acce ss from toplevel [\#32](https://github.com/voxpupuli/puppet-ghostbuster/issues/32)
155
+ - Refactor puppet-lint plugins [\#30](https://github.com/voxpupuli/puppet-ghostbuster/issues/30)
156
+ - Fix pending unit tests [\#29](https://github.com/voxpupuli/puppet-ghostbuster/issues/29)
157
+ - Refactor using plugins \(like puppet-lint\) [\#25](https://github.com/voxpupuli/puppet-ghostbuster/issues/25)
66
158
 
67
- - Don't use regex
159
+ **Merged pull requests:**
68
160
 
69
- ## [0.4.4](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.4) (2016-05-04)
70
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.3...0.4.4)
161
+ - Use a better regexp for manifests [\#34](https://github.com/voxpupuli/puppet-ghostbuster/pull/34) ([raphink](https://github.com/raphink))
162
+ - V2 refactor [\#31](https://github.com/voxpupuli/puppet-ghostbuster/pull/31) ([raphink](https://github.com/raphink))
163
+ - Use puppet-lint plugins [\#27](https://github.com/voxpupuli/puppet-ghostbuster/pull/27) ([mcanevet](https://github.com/mcanevet))
164
+ - Fix travis run \(fixes \#18\) [\#24](https://github.com/voxpupuli/puppet-ghostbuster/pull/24) ([mcanevet](https://github.com/mcanevet))
71
165
 
72
- **Fixed bugs:**
166
+ ## [0.4.5](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.5) (2016-05-04)
73
167
 
74
- - Fix unless/if issue
168
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.4...0.4.5)
75
169
 
76
- ## [0.4.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.3) (2016-05-04)
77
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.2...0.4.3)
170
+ ## [0.4.4](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.4) (2016-05-04)
78
171
 
79
- **Fixed bugs:**
172
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.3...0.4.4)
80
173
 
81
- - Less false positive
174
+ ## [0.4.3](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.3) (2016-05-04)
82
175
 
83
- ## [0.4.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.2) (2016-05-02)
84
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.1...0.4.2)
176
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.2...0.4.3)
85
177
 
86
- **Fixed bugs:**
178
+ **Merged pull requests:**
87
179
 
88
- - Fix variable name
180
+ - Resource params [\#23](https://github.com/voxpupuli/puppet-ghostbuster/pull/23) ([mcanevet](https://github.com/mcanevet))
181
+ - Implement --key, --cert and --ca options [\#22](https://github.com/voxpupuli/puppet-ghostbuster/pull/22) ([Phil0xF7](https://github.com/Phil0xF7))
89
182
 
90
- ## [0.4.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.1) (2016-05-02)
91
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.0...0.4.1)
183
+ ## [0.4.2](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.2) (2016-05-02)
92
184
 
93
- **Fixed bugs:**
185
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.1...0.4.2)
94
186
 
95
- - Fix unused files detection[\#20](https://github.com/camptocamp/puppet-ghostbuster/pull/20) ([mcanevet](https://github.com/mcanevet))
187
+ ## [0.4.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.1) (2016-05-02)
96
188
 
97
- ## [0.4.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.0) (2016-04-28)
98
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.3.0...0.4.0)
189
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.0...0.4.1)
99
190
 
100
- **Implemented enhancements:**
191
+ **Merged pull requests:**
192
+
193
+ - Fix unused files detection [\#20](https://github.com/voxpupuli/puppet-ghostbuster/pull/20) ([mcanevet](https://github.com/mcanevet))
101
194
 
102
- - Output to JSON[\#17](https://github.com/camptocamp/puppet-ghostbuster/pull/17) ([mcanevet](https://github.com/mcanevet))
195
+ ## [0.4.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.0) (2016-04-28)
103
196
 
104
- ## [0.3.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.3.0) (2016-04-26)
105
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.2.1...0.3.0)
197
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.2.1...0.4.0)
198
+
199
+ **Implemented enhancements:**
200
+
201
+ - Output to json [\#17](https://github.com/voxpupuli/puppet-ghostbuster/issues/17)
106
202
 
107
203
  **Fixed bugs:**
108
204
 
109
- - PuppetDB 3+ support [\#16](https://github.com/camptocamp/puppet-ghostbuster/pull/16) ([daenney](https://github.com/daenney))
205
+ - Fix unit tests [\#18](https://github.com/voxpupuli/puppet-ghostbuster/issues/18)
206
+
207
+ **Closed issues:**
208
+
209
+ - PuppetDB 3+ support [\#15](https://github.com/voxpupuli/puppet-ghostbuster/issues/15)
210
+
211
+ **Merged pull requests:**
110
212
 
111
- ## [0.2.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.2.1) (2015-10-07)
112
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.2.0...0.2.1)
213
+ - Output to JSON \(fixes \#17\) [\#19](https://github.com/voxpupuli/puppet-ghostbuster/pull/19) ([mcanevet](https://github.com/mcanevet))
214
+ - Configure client for PuppetDB API v4 [\#16](https://github.com/voxpupuli/puppet-ghostbuster/pull/16) ([daenney](https://github.com/daenney))
215
+
216
+ ## [0.2.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.2.1) (2015-10-07)
217
+
218
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.2.0...0.2.1)
113
219
 
114
220
  **Fixed bugs:**
115
221
 
116
- - Add documentation and allow relative paths in .ghostbusterignore file [\#12](https://github.com/camptocamp/puppet-ghostbuster/pull/12) ([roidelapluie](https://github.com/roidelapluie))
222
+ - Add documentation and allow relative paths in .ghostbusterignore file [\#12](https://github.com/voxpupuli/puppet-ghostbuster/pull/12) ([roidelapluie](https://github.com/roidelapluie))
223
+
224
+ ## [0.2.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.2.0) (2015-10-07)
117
225
 
118
- ## [0.2.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.2.0) (2015-10-07)
119
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.1.4...0.2.0)
226
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.1.4...0.2.0)
120
227
 
121
228
  **Implemented enhancements:**
122
229
 
123
- - Implement a .ghostbusterignore file [\#11](https://github.com/camptocamp/puppet-ghostbuster/pull/11) ([roidelapluie](https://github.com/roidelapluie))
230
+ - Implement a .ghostbusterignore file [\#11](https://github.com/voxpupuli/puppet-ghostbuster/pull/11) ([roidelapluie](https://github.com/roidelapluie))
124
231
 
125
- ## [0.1.4](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.4) (2015-09-14)
126
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.1.3...0.1.4)
232
+ ## [0.1.4](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.1.4) (2015-09-14)
233
+
234
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.1.3...0.1.4)
127
235
 
128
236
  **Implemented enhancements:**
129
237
 
130
- - Setup automatic releases on Travis CI [\#9](https://github.com/camptocamp/puppet-ghostbuster/issues/9)
238
+ - Setup automatic releases on Travis CI [\#9](https://github.com/voxpupuli/puppet-ghostbuster/issues/9)
131
239
 
132
240
  **Fixed bugs:**
133
241
 
134
- - Skip symlink files [\#10](https://github.com/camptocamp/puppet-ghostbuster/issues/10)
135
- - Search for files in all subfolders [\#8](https://github.com/camptocamp/puppet-ghostbuster/pull/8) ([roman-mueller](https://github.com/roman-mueller))
242
+ - Skip symlink files [\#10](https://github.com/voxpupuli/puppet-ghostbuster/issues/10)
243
+ - Search for files in all subfolders [\#8](https://github.com/voxpupuli/puppet-ghostbuster/pull/8) ([roman-mueller](https://github.com/roman-mueller))
244
+
245
+ ## [0.1.3](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.1.3) (2015-04-23)
136
246
 
137
- ## [0.1.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.3) (2015-04-23)
138
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.1.2...0.1.3)
247
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.1.2...0.1.3)
139
248
 
140
249
  **Implemented enhancements:**
141
250
 
142
- - add @@logger and log level option [\#5](https://github.com/camptocamp/puppet-ghostbuster/pull/5) ([saimonn](https://github.com/saimonn))
251
+ - add @@logger and log level option [\#5](https://github.com/voxpupuli/puppet-ghostbuster/pull/5) ([saimonn](https://github.com/saimonn))
143
252
 
144
- ## [0.1.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.2) (2015-04-23)
145
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.1.1...0.1.2)
253
+ ## [0.1.2](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.1.2) (2015-04-23)
146
254
 
147
- ## [0.1.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.1) (2015-04-23)
148
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.1.0...0.1.1)
255
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.1.1...0.1.2)
256
+
257
+ ## [0.1.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.1.1) (2015-04-23)
258
+
259
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.1.0...0.1.1)
149
260
 
150
261
  **Closed issues:**
151
262
 
152
- - Add support for non SSL [\#3](https://github.com/camptocamp/puppet-ghostbuster/issues/3)
263
+ - Add support for non SSL [\#3](https://github.com/voxpupuli/puppet-ghostbuster/issues/3)
264
+
265
+ ## [0.1.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.1.0) (2015-04-22)
153
266
 
154
- ## [0.1.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.0) (2015-04-22)
155
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.0.6...0.1.0)
267
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.0.6...0.1.0)
156
268
 
157
269
  **Implemented enhancements:**
158
270
 
159
- - Options/parser [\#2](https://github.com/camptocamp/puppet-ghostbuster/pull/2) ([saimonn](https://github.com/saimonn))
271
+ - Options/parser [\#2](https://github.com/voxpupuli/puppet-ghostbuster/pull/2) ([saimonn](https://github.com/saimonn))
272
+
273
+ ## [0.0.6](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.0.6) (2015-04-22)
274
+
275
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.0.5...0.0.6)
160
276
 
161
- ## [0.0.6](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.6) (2015-04-22)
162
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.0.5...0.0.6)
277
+ ## [0.0.5](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.0.5) (2015-04-22)
163
278
 
164
- ## [0.0.5](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.5) (2015-04-22)
165
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.0.4...0.0.5)
279
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.0.4...0.0.5)
166
280
 
167
281
  **Implemented enhancements:**
168
282
 
169
- - Manage templates [\#1](https://github.com/camptocamp/puppet-ghostbuster/pull/1) ([mcanevet](https://github.com/mcanevet))
283
+ - Manage templates [\#1](https://github.com/voxpupuli/puppet-ghostbuster/pull/1) ([mcanevet](https://github.com/mcanevet))
284
+
285
+ ## [0.0.4](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.0.4) (2015-04-21)
286
+
287
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.0.2...0.0.4)
288
+
289
+ ## [0.0.2](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.0.2) (2015-04-21)
290
+
291
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.0.1...0.0.2)
170
292
 
171
- ## [0.0.4](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.4) (2015-04-21)
172
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.0.2...0.0.4)
293
+ ## [0.0.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.0.1) (2015-04-21)
173
294
 
174
- ## [0.0.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.2) (2015-04-21)
175
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.0.1...0.0.2)
295
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0fb67b04292525eb0b75756da85f63ad900d2cb0...0.0.1)
176
296
 
177
- ## [0.0.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.1) (2015-04-21)
178
297
 
179
298
 
180
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
299
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,3 +1,15 @@
1
- source ENV['GEM_SOURCE'] || "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
4
 
3
5
  gemspec
6
+
7
+ group :release do
8
+ gem 'faraday-retry', '~> 2.1', require: false
9
+ gem 'github_changelog_generator', '~> 1.16.4', require: false
10
+ end
11
+
12
+ group :coverage, optional: ENV['COVERAGE'] != 'yes' do
13
+ gem 'codecov', require: false
14
+ gem 'simplecov-console', require: false
15
+ end
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  puppet-ghostbuster
2
2
  ==================
3
3
 
4
- [![Build Status](https://img.shields.io/travis/camptocamp/puppet-ghostbuster.svg)](https://travis-ci.org/camptocamp/puppet-ghostbuster)
5
- [![Gem Version](https://img.shields.io/gem/v/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster)
6
- [![Gem Downloads](https://img.shields.io/gem/dt/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster)
7
- [![Gemnasium](https://img.shields.io/gemnasium/camptocamp/puppet-ghostbuster.svg)](https://gemnasium.com/camptocamp/puppet-ghostbuster)
4
+ [![License](https://img.shields.io/github/license/voxpupuli/puppet-ghostbuster.svg)](https://github.com/voxpupuli/puppet-ghostbuster/blob/master/LICENSE)
5
+ [![Test](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/test.yml)
6
+ [![Release](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-ghostbuster/actions/workflows/release.yml)
7
+ [![RubyGem Version](https://img.shields.io/gem/v/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster)
8
+ [![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-ghostbuster.svg)](https://rubygems.org/gems/puppet-ghostbuster)
9
+ [![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)
8
10
 
9
11
  When you have dead puppet code hanging around ...
10
12
  *Who you gonna call ?*
@@ -63,7 +65,7 @@ Find unused facts in Puppet manifests and templates.
63
65
 
64
66
  Find unused files in PuppetDB or in Puppet manifests.
65
67
 
66
- ### ghsotbuster_functions
68
+ ### ghostbuster_functions
67
69
 
68
70
  Find unused functions in Puppet manifests or templates.
69
71
 
@@ -95,3 +97,11 @@ $ find . -type f -exec puppet-lint --only-checks ghostbuster_classes,ghostbuster
95
97
  ./modules/foo/files/bar.txt - WARNING: File foo/bar.txt seems unused on line 1
96
98
  ./modules/foo/files/baz.txt - WARNING: File foo/baz.txt seems unused on line 1
97
99
  ```
100
+
101
+ ## Transfer Notice
102
+
103
+ This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
104
+ The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
105
+ Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.
106
+
107
+ Previously: https://github.com/camptocamp/puppet-ghostbuster
data/Rakefile CHANGED
@@ -1,14 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task default: :spec
8
+
1
9
  begin
2
- require 'rspec/core/rake_task'
3
- RSpec::Core::RakeTask.new(:spec)
10
+ require 'rubygems'
11
+ require 'github_changelog_generator/task'
4
12
  rescue LoadError
13
+ # github-changelog-generator is an optional group
14
+ else
15
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
16
+ config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
17
+ config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog modulesync]
18
+ config.user = 'voxpupuli'
19
+ config.project = 'puppet-ghostbuster'
20
+ config.future_release = Gem::Specification.load("#{config.project}.gemspec").version
21
+ end
5
22
  end
6
23
 
7
- require 'github_changelog_generator/task'
8
- require 'puppet-ghostbuster/version'
9
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
10
- config.future_release = PuppetGhostbuster::VERSION
11
- config.release_url = "https://rubygems.org/gems/puppet-ghostbuster/versions/%s"
12
- end
24
+ begin
25
+ require 'rubocop/rake_task'
26
+ rescue LoadError
27
+ # RuboCop is an optional group
28
+ else
29
+ RuboCop::RakeTask.new(:rubocop) do |task|
30
+ # These make the rubocop experience maybe slightly less terrible
31
+ task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
13
32
 
14
- task :default => :spec
33
+ # Use Rubocop's Github Actions formatter if possible
34
+ task.formatters << 'github' if ENV['GITHUB_ACTIONS'] == 'true'
35
+ end
36
+ end
@@ -1,16 +1,26 @@
1
1
  require 'puppetdb'
2
+ require 'puppet'
2
3
 
3
4
  class PuppetGhostbuster
4
5
  class PuppetDB
6
+ Puppet.initialize_settings
7
+
8
+ begin
9
+ require 'puppet/util/puppetdb'
10
+ @@puppetdb = Puppet::Util::Puppetdb.config.server_urls[0]
11
+ rescue LoadError
12
+ @@puppetdb = "https://#{Puppet[:server]}:8081"
13
+ end
14
+
5
15
  def self.client
6
16
  @@client ||= ::PuppetDB::Client.new({
7
- :server => "#{ENV['PUPPETDB_URL'] || 'http://puppetdb:8080'}/pdb/query",
8
- :pem => {
9
- 'key' => ENV['PUPPETDB_KEY_FILE'],
10
- 'cert' => ENV['PUPPETDB_CERT_FILE'],
11
- 'ca_file' => ENV['PUPPETDB_CACERT_FILE'],
12
- }
13
- }, 4)
17
+ server: ENV['PUPPETDB_URL'] || @@puppetdb,
18
+ pem: {
19
+ 'key' => ENV['PUPPETDB_KEY_FILE'] || Puppet[:hostprivkey],
20
+ 'cert' => ENV['PUPPETDB_CERT_FILE'] || Puppet[:hostcert],
21
+ 'ca_file' => ENV['PUPPETDB_CACERT_FILE'] || Puppet[:localcacert],
22
+ },
23
+ }, 4)
14
24
  end
15
25
 
16
26
  def client
@@ -18,11 +28,24 @@ class PuppetGhostbuster
18
28
  end
19
29
 
20
30
  def self.classes
21
- @@classes ||= client.request('resources', [:'=', 'type', 'Class']).data.map { |r| r['title'] }.uniq
31
+ @@classes ||= client.request('',
32
+ 'resources[title] { type = "Class" and nodes { deactivated is null } }').data.map do |r|
33
+ r['title']
34
+ end.uniq
22
35
  end
23
36
 
24
37
  def classes
25
38
  self.class.classes
26
39
  end
40
+
41
+ def self.resources
42
+ @@resources ||= client.request('', 'resources[type] { nodes { deactivated is null } }').data.map do |r|
43
+ r['type']
44
+ end.uniq
45
+ end
46
+
47
+ def resources
48
+ self.class.resources
49
+ end
27
50
  end
28
51
  end
@@ -1,3 +1,3 @@
1
1
  class PuppetGhostbuster
2
- VERSION = '0.8.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -8,7 +8,7 @@ class PuppetLint::Checks
8
8
  PuppetLint::Data.manifest_lines = content.split("\n", -1)
9
9
  PuppetLint::Data.tokens = lexer.tokenise(content)
10
10
  PuppetLint::Data.parse_control_comments
11
- rescue
11
+ rescue StandardError
12
12
  PuppetLint::Data.tokens = []
13
13
  end
14
14
  end
@@ -27,9 +27,9 @@ PuppetLint.new_check(:ghostbuster_classes) do
27
27
  return if puppetdb.classes.include? title
28
28
 
29
29
  notify :warning, {
30
- :message => "Class #{title} seems unused",
31
- :line => title_token.line,
32
- :column => title_token.column,
30
+ message: "Class #{title} seems unused",
31
+ line: title_token.line,
32
+ column: title_token.column,
33
33
  }
34
34
  end
35
35
  end
@@ -8,7 +8,7 @@ class PuppetLint::Checks
8
8
  PuppetLint::Data.manifest_lines = content.split("\n", -1)
9
9
  PuppetLint::Data.tokens = lexer.tokenise(content)
10
10
  PuppetLint::Data.parse_control_comments
11
- rescue
11
+ rescue StandardError
12
12
  PuppetLint::Data.tokens = []
13
13
  end
14
14
  end
@@ -24,14 +24,13 @@ PuppetLint.new_check(:ghostbuster_defines) do
24
24
  title_token = define_idx[:name_token]
25
25
  type = title_token.value.split('::').map(&:capitalize).join('::')
26
26
 
27
- return if puppetdb.client.request('resources', [:'=', 'type', type]).data.size > 0
27
+ return if puppetdb.resources.include? type
28
28
 
29
29
  notify :warning, {
30
- :message => "Define #{type} seems unused",
31
- :line => title_token.line,
32
- :column => title_token.column,
30
+ message: "Define #{type} seems unused",
31
+ line: title_token.line,
32
+ column: title_token.column,
33
33
  }
34
34
  end
35
35
  end
36
36
  end
37
-