puppet-ghostbuster 0.9.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +206 -96
  9. data/Gemfile +13 -1
  10. data/README.md +15 -5
  11. data/Rakefile +31 -9
  12. data/lib/puppet-ghostbuster/puppetdb.rb +24 -9
  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 +4 -5
  16. data/lib/puppet-lint/plugins/check_ghostbuster_facts.rb +14 -15
  17. data/lib/puppet-lint/plugins/check_ghostbuster_files.rb +9 -9
  18. data/lib/puppet-lint/plugins/check_ghostbuster_functions.rb +8 -8
  19. data/lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb +30 -31
  20. data/lib/puppet-lint/plugins/check_ghostbuster_templates.rb +13 -10
  21. data/lib/puppet-lint/plugins/check_ghostbuster_types.rb +4 -4
  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 +33 -34
  44. metadata +76 -36
  45. data/.travis.yml +0 -20
data/CHANGELOG.md CHANGED
@@ -1,189 +1,299 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- ## [0.9.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.9.0) (2017-08-18)
4
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.8.0...0.9.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)
7
6
 
8
- - Use PQL queries to filter out deactivated nodes
9
- - Cache known resources
10
- - Build on Ruby 2.3.1
7
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/1.0.0...1.1.0)
11
8
 
12
- ## [0.8.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.8.0) (2016-09-23)
13
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.3...0.8.0)
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.
14
10
 
15
- **Implemented enhancements:**
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)
39
+
40
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.8.0...0.9.0)
41
+
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)
16
53
 
17
- - Supports Puppet-lint 2.0.
54
+ ## [0.7.3](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.3) (2016-06-08)
18
55
 
19
- ## [0.7.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.3) (2016-06-08)
20
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.2...0.7.3)
56
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.7.2...0.7.3)
21
57
 
22
58
  **Fixed bugs:**
23
59
 
24
- - 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))
65
+
66
+ ## [0.7.2](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.2) (2016-05-19)
25
67
 
26
- ## [0.7.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.2) (2016-05-19)
27
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.1...0.7.2)
68
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.7.1...0.7.2)
28
69
 
29
70
  **Fixed bugs:**
30
71
 
31
- - Detect facts used in inline_templates()
72
+ - Facts used in inline\_templates are not detected [\#53](https://github.com/voxpupuli/puppet-ghostbuster/issues/53)
32
73
 
33
- ## [0.7.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.1) (2016-05-16)
34
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.0...0.7.1)
74
+ **Merged pull requests:**
35
75
 
36
- **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:**
83
+
84
+ - Use puppetdb instead of manifests for unused types detection [\#52](https://github.com/voxpupuli/puppet-ghostbuster/pull/52) ([mcanevet](https://github.com/mcanevet))
37
85
 
38
- - Add missing documentation.
39
- - Use PuppetDB instead of manifests to detect unused types.
86
+ ## [0.7.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.7.0) (2016-05-16)
40
87
 
41
- ## [0.7.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.0) (2016-05-16)
42
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.6.0...0.7.0)
88
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.6.0...0.7.0)
43
89
 
44
90
  **Implemented enhancements:**
45
91
 
46
- - Detect unused facts.
47
- - Detect unused functions.
48
- - 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)
49
95
 
50
- ## [0.6.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.6.0) (2016-05-12)
51
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.5.1...0.6.0)
96
+ **Closed issues:**
97
+
98
+ - Use fixtures for puppetdb calls [\#42](https://github.com/voxpupuli/puppet-ghostbuster/issues/42)
99
+
100
+ **Merged pull requests:**
101
+
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)
52
110
 
53
111
  **Implemented enhancements:**
54
112
 
55
- - 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))
118
+
119
+ ## [0.5.1](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.5.1) (2016-05-11)
56
120
 
57
- ## [0.5.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.5.1) (2016-05-11)
58
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.5.0...0.5.1)
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)
59
127
 
60
128
  **Fixed bugs:**
61
129
 
62
- - 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))
63
141
 
64
- ## [0.5.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.5.0) (2016-05-10)
65
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.5...0.5.0)
142
+ ## [0.5.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.5.0) (2016-05-10)
143
+
144
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.5...0.5.0)
66
145
 
67
146
  **Implemented enhancements:**
68
147
 
69
- - Major Reimplementation. Delivered as puppet-lint plugins.
148
+ - refactor puppet db queries \(self.client\) [\#7](https://github.com/voxpupuli/puppet-ghostbuster/issues/7)
70
149
 
71
- ## [0.4.5](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.5) (2016-05-04)
72
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.4.4...0.4.5)
150
+ **Closed issues:**
73
151
 
74
- **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)
75
158
 
76
- - Don't use regex
159
+ **Merged pull requests:**
77
160
 
78
- ## [0.4.4](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.4) (2016-05-04)
79
- [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))
80
165
 
81
- **Fixed bugs:**
166
+ ## [0.4.5](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.5) (2016-05-04)
82
167
 
83
- - Fix unless/if issue
168
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.4...0.4.5)
84
169
 
85
- ## [0.4.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.3) (2016-05-04)
86
- [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)
87
171
 
88
- **Fixed bugs:**
172
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.3...0.4.4)
89
173
 
90
- - Less false positive
174
+ ## [0.4.3](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.3) (2016-05-04)
91
175
 
92
- ## [0.4.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.2) (2016-05-02)
93
- [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)
94
177
 
95
- **Fixed bugs:**
178
+ **Merged pull requests:**
96
179
 
97
- - 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))
98
182
 
99
- ## [0.4.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.1) (2016-05-02)
100
- [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)
101
184
 
102
- **Fixed bugs:**
185
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.4.1...0.4.2)
103
186
 
104
- - 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)
105
188
 
106
- ## [0.4.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.4.0) (2016-04-28)
107
- [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)
108
190
 
109
- **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))
194
+
195
+ ## [0.4.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/0.4.0) (2016-04-28)
196
+
197
+ [Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/0.2.1...0.4.0)
110
198
 
111
- - Output to JSON[\#17](https://github.com/camptocamp/puppet-ghostbuster/pull/17) ([mcanevet](https://github.com/mcanevet))
199
+ **Implemented enhancements:**
112
200
 
113
- ## [0.3.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.3.0) (2016-04-26)
114
- [Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.2.1...0.3.0)
201
+ - Output to json [\#17](https://github.com/voxpupuli/puppet-ghostbuster/issues/17)
115
202
 
116
203
  **Fixed bugs:**
117
204
 
118
- - 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:**
119
212
 
120
- ## [0.2.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.2.1) (2015-10-07)
121
- [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)
122
219
 
123
220
  **Fixed bugs:**
124
221
 
125
- - 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)
126
225
 
127
- ## [0.2.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.2.0) (2015-10-07)
128
- [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)
129
227
 
130
228
  **Implemented enhancements:**
131
229
 
132
- - 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))
133
231
 
134
- ## [0.1.4](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.4) (2015-09-14)
135
- [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)
136
235
 
137
236
  **Implemented enhancements:**
138
237
 
139
- - 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)
140
239
 
141
240
  **Fixed bugs:**
142
241
 
143
- - Skip symlink files [\#10](https://github.com/camptocamp/puppet-ghostbuster/issues/10)
144
- - 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)
145
246
 
146
- ## [0.1.3](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.3) (2015-04-23)
147
- [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)
148
248
 
149
249
  **Implemented enhancements:**
150
250
 
151
- - 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))
152
252
 
153
- ## [0.1.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.2) (2015-04-23)
154
- [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)
155
254
 
156
- ## [0.1.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.1) (2015-04-23)
157
- [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)
158
260
 
159
261
  **Closed issues:**
160
262
 
161
- - 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)
162
266
 
163
- ## [0.1.0](https://rubygems.org/gems/puppet-ghostbuster/versions/0.1.0) (2015-04-22)
164
- [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)
165
268
 
166
269
  **Implemented enhancements:**
167
270
 
168
- - 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)
169
276
 
170
- ## [0.0.6](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.6) (2015-04-22)
171
- [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)
172
278
 
173
- ## [0.0.5](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.5) (2015-04-22)
174
- [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)
175
280
 
176
281
  **Implemented enhancements:**
177
282
 
178
- - 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)
179
292
 
180
- ## [0.0.4](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.4) (2015-04-21)
181
- [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)
182
294
 
183
- ## [0.0.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.2) (2015-04-21)
184
- [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)
185
296
 
186
- ## [0.0.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.0.1) (2015-04-21)
187
297
 
188
298
 
189
- \* *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'}",
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,7 +28,10 @@ class PuppetGhostbuster
18
28
  end
19
29
 
20
30
  def self.classes
21
- @@classes ||= client.request('', 'resources[title] { type = "Class" and nodes { deactivated is null } }').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
@@ -26,7 +39,9 @@ class PuppetGhostbuster
26
39
  end
27
40
 
28
41
  def self.resources
29
- @@resources ||= client.request('', 'resources[type] { nodes { deactivated is null } }').data.map { |r| r['type'] }.uniq
42
+ @@resources ||= client.request('', 'resources[type] { nodes { deactivated is null } }').data.map do |r|
43
+ r['type']
44
+ end.uniq
30
45
  end
31
46
 
32
47
  def resources
@@ -1,3 +1,3 @@
1
1
  class PuppetGhostbuster
2
- VERSION = '0.9.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
@@ -27,11 +27,10 @@ PuppetLint.new_check(:ghostbuster_defines) do
27
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
-