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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7fd0578b7418b3a9ec4293c472e1dca897a6418d
4
- data.tar.gz: 87358497e0a8e39d82d785f0557515f59465355b
2
+ SHA256:
3
+ metadata.gz: 3ec9b23a16d99a0943b30208b38c1445112a1bd359f26c3c161d3b7721f95b90
4
+ data.tar.gz: c5fb473512bc43557378a83f318911709a1d475f81727da4f25e9beb96de47d9
5
5
  SHA512:
6
- metadata.gz: 9f97143c1e2252c9abf4a256e0739c823fc25103ef7ab639a6cc3b5065fb65be75d10b0f0b6ea50eed4e146d540f54c78b357d5d873a078d4a0e502b84486012
7
- data.tar.gz: a6f023e7d57d327920d4b2a64f0eed8c4a7f3f37b697bc699df0e23aaf001e90cb0da19fafb1360868f060ee6e02f9c94d892c22190b8bfda2c0654f996ba3f5
6
+ metadata.gz: bf4b7b687a058bb87c4af83be99d25deb8f2dc8fc48780a4c798dbe52a4ce5180f374cc023dc362e9c414327d298a942896c42deb2d6411a0ec357649ead7969
7
+ data.tar.gz: 5e9a5b44cb3e34c09d68e8e332144568b92cb8cfdd20fed57e3206fbec9b4e11e0cabea9752622640109b70cc2fd26d6f8134548444ec7c699729965cfaaf38c
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ # raise PRs for gem updates
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ time: "13:00"
9
+ open-pull-requests-limit: 10
10
+
11
+ # Maintain dependencies for GitHub Actions
12
+ - package-ecosystem: github-actions
13
+ directory: "/"
14
+ schedule:
15
+ interval: daily
16
+ time: "13:00"
17
+ open-pull-requests-limit: 10
@@ -0,0 +1,33 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ if: github.repository_owner == 'voxpupuli'
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Install Ruby 3.0
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: '3.0'
18
+ bundler: 'none'
19
+ env:
20
+ BUNDLE_WITHOUT: release:development:rubocop
21
+ - name: Build gem
22
+ run: gem build --strict --verbose *.gemspec
23
+ - name: Publish gem to rubygems.org
24
+ run: gem push *.gem
25
+ env:
26
+ GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
27
+ - name: Setup GitHub packages access
28
+ run: |
29
+ mkdir -p ~/.gem
30
+ echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
31
+ chmod 0600 ~/.gem/credentials
32
+ - name: Publish gem to GitHub packages
33
+ run: gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
@@ -0,0 +1,57 @@
1
+ name: Test
2
+
3
+ on:
4
+ pull_request: {}
5
+ push:
6
+ branches:
7
+ - master
8
+ - main
9
+
10
+ env:
11
+ BUNDLE_WITHOUT: release
12
+
13
+ jobs:
14
+ rubocop:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Setup ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: '3.0'
22
+ bundler-cache: true
23
+ - name: Run rake rubocop
24
+ run: bundle exec rake rubocop
25
+ test:
26
+ runs-on: ubuntu-latest
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ include:
31
+ - ruby: "2.7"
32
+ - ruby: "3.0"
33
+ - ruby: "3.1"
34
+ coverage: "yes"
35
+ - ruby: "3.2"
36
+ env:
37
+ COVERAGE: ${{ matrix.coverage }}
38
+ name: Ruby ${{ matrix.ruby }}
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ - name: Install Ruby ${{ matrix.ruby }}
42
+ uses: ruby/setup-ruby@v1
43
+ with:
44
+ ruby-version: ${{ matrix.ruby }}
45
+ bundler-cache: true
46
+ - name: Run tests
47
+ run: bundle exec rake spec
48
+ - name: Verify gem builds
49
+ run: gem build --strict --verbose *.gemspec
50
+ tests:
51
+ needs:
52
+ - rubocop
53
+ - test
54
+ runs-on: ubuntu-latest
55
+ name: Test suite
56
+ steps:
57
+ - run: echo Test suite completed
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
- *.gem
2
- *.swp
3
- Gemfile.lock
4
- .bundle/
1
+ /.bundle/
2
+ /vendor/gems/
3
+ /Gemfile.lock
4
+ vendor/bundle
5
+ .vendor/
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ ---
2
+ inherit_from: .rubocop_todo.yml
3
+
4
+ # Managed by modulesync - DO NOT EDIT
5
+ # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
6
+
7
+ inherit_gem:
8
+ voxpupuli-rubocop: rubocop.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,170 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2024-01-08 10:34:35 UTC using RuboCop version 1.59.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports unsafe autocorrection (--autocorrect-all).
11
+ # Configuration parameters: AllowSafeAssignment.
12
+ Lint/AssignmentInCondition:
13
+ Exclude:
14
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
15
+
16
+ # Offense count: 6
17
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
18
+ Lint/EmptyBlock:
19
+ Exclude:
20
+ - 'spec/fixtures/modules/foo/lib/puppet/parser/functions/bar.rb'
21
+ - 'spec/fixtures/modules/foo/lib/puppet/parser/functions/baz.rb'
22
+ - 'spec/fixtures/modules/foo/lib/puppet/parser/functions/foo.rb'
23
+ - 'spec/fixtures/modules/foo/lib/puppet/parser/functions/quux.rb'
24
+ - 'spec/fixtures/modules/foo/lib/puppet/type/bar.rb'
25
+ - 'spec/fixtures/modules/foo/lib/puppet/type/foo.rb'
26
+
27
+ # Offense count: 12
28
+ Lint/NonLocalExitFromIterator:
29
+ Exclude:
30
+ - 'lib/puppet-lint/plugins/check_ghostbuster_classes.rb'
31
+ - 'lib/puppet-lint/plugins/check_ghostbuster_defines.rb'
32
+ - 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
33
+ - 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
34
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
35
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
36
+
37
+ # Offense count: 1
38
+ # Configuration parameters: AllowKeywordBlockArguments.
39
+ Lint/UnderscorePrefixedVariableName:
40
+ Exclude:
41
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
42
+
43
+ # Offense count: 1
44
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
45
+ # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
46
+ Naming/MethodParameterName:
47
+ Exclude:
48
+ - 'spec/spec_helper.rb'
49
+
50
+ # Offense count: 8
51
+ # Configuration parameters: IgnoredMetadata.
52
+ RSpec/DescribeClass:
53
+ Exclude:
54
+ - '**/spec/features/**/*'
55
+ - '**/spec/requests/**/*'
56
+ - '**/spec/routing/**/*'
57
+ - '**/spec/system/**/*'
58
+ - '**/spec/views/**/*'
59
+ - 'spec/puppet-lint/plugins/ghostbuster_classes_spec.rb'
60
+ - 'spec/puppet-lint/plugins/ghostbuster_defines_spec.rb'
61
+ - 'spec/puppet-lint/plugins/ghostbuster_facts_spec.rb'
62
+ - 'spec/puppet-lint/plugins/ghostbuster_files_spec.rb'
63
+ - 'spec/puppet-lint/plugins/ghostbuster_functions_spec.rb'
64
+ - 'spec/puppet-lint/plugins/ghostbuster_hiera_files_spec.rb'
65
+ - 'spec/puppet-lint/plugins/ghostbuster_templates_spec.rb'
66
+ - 'spec/puppet-lint/plugins/ghostbuster_types_spec.rb'
67
+
68
+ # Offense count: 2
69
+ RSpec/RepeatedDescription:
70
+ Exclude:
71
+ - 'spec/puppet-lint/plugins/ghostbuster_facts_spec.rb'
72
+
73
+ # Offense count: 9
74
+ # This cop supports unsafe autocorrection (--autocorrect-all).
75
+ # Configuration parameters: EnforcedStyle.
76
+ # SupportedStyles: nested, compact
77
+ Style/ClassAndModuleChildren:
78
+ Exclude:
79
+ - 'lib/puppet-lint/plugins/check_ghostbuster_classes.rb'
80
+ - 'lib/puppet-lint/plugins/check_ghostbuster_defines.rb'
81
+ - 'lib/puppet-lint/plugins/check_ghostbuster_facts.rb'
82
+ - 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
83
+ - 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
84
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
85
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
86
+ - 'lib/puppet-lint/plugins/check_ghostbuster_types.rb'
87
+ - 'spec/spec_helper.rb'
88
+
89
+ # Offense count: 5
90
+ Style/ClassVars:
91
+ Exclude:
92
+ - 'lib/puppet-ghostbuster/puppetdb.rb'
93
+
94
+ # Offense count: 9
95
+ # Configuration parameters: AllowedConstants.
96
+ Style/Documentation:
97
+ Exclude:
98
+ - 'spec/**/*'
99
+ - 'test/**/*'
100
+ - 'lib/puppet-ghostbuster/puppetdb.rb'
101
+ - 'lib/puppet-lint/plugins/check_ghostbuster_classes.rb'
102
+ - 'lib/puppet-lint/plugins/check_ghostbuster_defines.rb'
103
+ - 'lib/puppet-lint/plugins/check_ghostbuster_facts.rb'
104
+ - 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
105
+ - 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
106
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
107
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
108
+ - 'lib/puppet-lint/plugins/check_ghostbuster_types.rb'
109
+
110
+ # Offense count: 11
111
+ # This cop supports unsafe autocorrection (--autocorrect-all).
112
+ # Configuration parameters: EnforcedStyle.
113
+ # SupportedStyles: always, always_true, never
114
+ Style/FrozenStringLiteralComment:
115
+ Exclude:
116
+ - 'lib/puppet-ghostbuster/puppetdb.rb'
117
+ - 'lib/puppet-ghostbuster/version.rb'
118
+ - 'lib/puppet-lint/plugins/check_ghostbuster_classes.rb'
119
+ - 'lib/puppet-lint/plugins/check_ghostbuster_defines.rb'
120
+ - 'lib/puppet-lint/plugins/check_ghostbuster_facts.rb'
121
+ - 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
122
+ - 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
123
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
124
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
125
+ - 'lib/puppet-lint/plugins/check_ghostbuster_types.rb'
126
+ - 'spec/spec_helper.rb'
127
+
128
+ # Offense count: 2
129
+ # This cop supports safe autocorrection (--autocorrect).
130
+ Style/IfUnlessModifier:
131
+ Exclude:
132
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
133
+
134
+ # Offense count: 1
135
+ # This cop supports unsafe autocorrection (--autocorrect-all).
136
+ # Configuration parameters: EnforcedStyle.
137
+ # SupportedStyles: literals, strict
138
+ Style/MutableConstant:
139
+ Exclude:
140
+ - 'lib/puppet-ghostbuster/version.rb'
141
+
142
+ # Offense count: 15
143
+ # This cop supports unsafe autocorrection (--autocorrect-all).
144
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
145
+ # SupportedStyles: predicate, comparison
146
+ Style/NumericPredicate:
147
+ Exclude:
148
+ - 'spec/**/*'
149
+ - 'lib/puppet-lint/plugins/check_ghostbuster_facts.rb'
150
+ - 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
151
+ - 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
152
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
153
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
154
+
155
+ # Offense count: 15
156
+ # This cop supports unsafe autocorrection (--autocorrect-all).
157
+ Style/ZeroLengthPredicate:
158
+ Exclude:
159
+ - 'lib/puppet-lint/plugins/check_ghostbuster_facts.rb'
160
+ - 'lib/puppet-lint/plugins/check_ghostbuster_files.rb'
161
+ - 'lib/puppet-lint/plugins/check_ghostbuster_functions.rb'
162
+ - 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb'
163
+ - 'lib/puppet-lint/plugins/check_ghostbuster_templates.rb'
164
+
165
+ # Offense count: 4
166
+ # This cop supports safe autocorrection (--autocorrect).
167
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
168
+ # URISchemes: http, https
169
+ Layout/LineLength:
170
+ Max: 189