puppet-lint-spaceship_operator_without_tag-check 0.1.0 → 1.0.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2eaa47ef5cb78081f72d872af53d2d194e48760387109f3c641e61e35b8347d9
|
4
|
+
data.tar.gz: cb258cac73e972c42b01ea61df0637734a172c4f92e1d30d163384f92cf5978b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 430cb862ea3ae005d2ef141ca998b6e64ae506310d2864aac96ef842a2e0241fa600b57ab93ac334fc71aa3d058a266d29db3d7d045c3092def958d5816bde79
|
7
|
+
data.tar.gz: a771cc3036835625dc9c2b97bd76f21da4f8237c0f0622dcd18214d2d87f8cbd8c846765a3d6d639c51b24dbb353ce4508e6269a4c9e80c764f27a9fb1766c83
|
data/README.md
CHANGED
@@ -1,42 +1,83 @@
|
|
1
1
|
puppet-lint-spaceship_operator_without_tag-check
|
2
|
-
|
2
|
+
================================================
|
3
3
|
|
4
|
-
[](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/blob/master/LICENSE)
|
5
|
+
[](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/actions/workflows/test.yml)
|
6
|
+
[](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/actions/workflows/release.yml)
|
7
|
+
[](https://rubygems.org/gems/puppet-lint-spaceship_operator_without_tag-check)
|
8
|
+
[](https://rubygems.org/gems/puppet-lint-spaceship_operator_without_tag-check)
|
9
|
+
[](#transfer-notice)
|
8
10
|
|
9
11
|
A puppet-lint plugin to check that spaceship operator is called with a tag.
|
10
12
|
|
13
|
+
## Installing
|
14
|
+
|
15
|
+
### From the command line
|
16
|
+
|
17
|
+
```shell
|
18
|
+
$ gem install puppet-lint-spaceship_operator_without_tag-check
|
19
|
+
```
|
20
|
+
|
21
|
+
### In a Gemfile
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false
|
25
|
+
```
|
11
26
|
|
12
27
|
## Checks
|
13
28
|
|
14
29
|
### Spaceship operator without tag
|
15
30
|
|
16
|
-
Calling spaceship operator (<| |>) without tag can be dangerous because it will realise all virtual resources of that type.
|
31
|
+
Calling spaceship operator (<| |>) without tag can be dangerous because it will realise all virtual resources of that type (https://tickets.puppetlabs.com/browse/PUP-3825).
|
17
32
|
|
18
33
|
#### What you have done
|
19
34
|
|
20
35
|
```puppet
|
21
|
-
|
36
|
+
class foo {
|
37
|
+
Package <| |>
|
38
|
+
}
|
22
39
|
```
|
23
40
|
|
24
41
|
#### What you should have done
|
25
42
|
|
26
43
|
```puppet
|
27
|
-
|
44
|
+
class foo {
|
45
|
+
Package <| tag == 'foo' |>
|
46
|
+
}
|
28
47
|
```
|
29
48
|
|
30
49
|
#### Disabling the check
|
31
50
|
|
32
|
-
To disable this check, you can add `--no-
|
51
|
+
To disable this check, you can add `--no-spaceship_operator_without_tag-check` to your puppet-lint command line.
|
33
52
|
|
34
53
|
```shell
|
35
|
-
$ puppet-lint --no-
|
54
|
+
$ puppet-lint --no-spaceship_operator_without_tag-check path/to/file.pp
|
36
55
|
```
|
37
56
|
|
38
57
|
Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your `Rakefile`.
|
39
58
|
|
40
59
|
```ruby
|
41
|
-
PuppetLint.configuration.send('
|
60
|
+
PuppetLint.configuration.send('disable_spaceship_operator_without_tag')
|
42
61
|
```
|
62
|
+
|
63
|
+
## Transfer Notice
|
64
|
+
|
65
|
+
This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
|
66
|
+
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
|
67
|
+
Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.
|
68
|
+
|
69
|
+
Previously: https://github.com/camptocamp/puppet-lint-spaceship_operator_without_tag-check
|
70
|
+
|
71
|
+
## License
|
72
|
+
|
73
|
+
This gem is licensed under the Apache-2 license.
|
74
|
+
|
75
|
+
## Release information
|
76
|
+
|
77
|
+
To make a new release, please do:
|
78
|
+
* update the version in the gemspec file
|
79
|
+
* Install gems with `bundle install --with release --path .vendor`
|
80
|
+
* generate the changelog with `bundle exec rake changelog`
|
81
|
+
* Check if the new version matches the closed issues/PRs in the changelog
|
82
|
+
* Create a PR with it
|
83
|
+
* After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
|
@@ -1,14 +1,14 @@
|
|
1
1
|
PuppetLint.new_check(:spaceship_operator_without_tag) do
|
2
2
|
def check
|
3
3
|
tokens.each do |t|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
next unless t.type == :LCOLLECT and t.next_code_token.type == :RCOLLECT
|
5
|
+
|
6
|
+
notify :warning, {
|
7
|
+
message: 'spaceship operator without tag',
|
8
|
+
line: t.line,
|
9
|
+
column: t.column,
|
10
|
+
token: t,
|
11
|
+
}
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -6,37 +6,37 @@ describe 'spaceship_operator_without_tag' do
|
|
6
6
|
context 'with fix disabled' do
|
7
7
|
context 'spaceship operator with tag' do
|
8
8
|
let(:code) do
|
9
|
-
|
10
|
-
Foo<| tag != 'virtual' |>
|
11
|
-
Bar<| tag == 'bar' |> -> Baz <| tag == 'baz' |>
|
9
|
+
<<~EOS
|
10
|
+
Foo<| tag != 'virtual' |>
|
11
|
+
Bar<| tag == 'bar' |> -> Baz <| tag == 'baz' |>
|
12
12
|
EOS
|
13
13
|
end
|
14
14
|
|
15
|
-
it '
|
15
|
+
it 'does not detect any problems' do
|
16
16
|
expect(problems).to have(0).problems
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
context 'spaceship operator without tag' do
|
21
21
|
let(:code) do
|
22
|
-
|
23
|
-
Foo<| |>
|
22
|
+
<<~EOS
|
23
|
+
Foo<| |>
|
24
24
|
EOS
|
25
25
|
end
|
26
26
|
|
27
|
-
it '
|
27
|
+
it 'detects a problems' do
|
28
28
|
expect(problems).to have(1).problems
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
context 'spaceship operator with and without tag' do
|
33
33
|
let(:code) do
|
34
|
-
|
35
|
-
Bar<| tag == 'bar' |> -> Baz <| |>
|
34
|
+
<<~EOS
|
35
|
+
Bar<| tag == 'bar' |> -> Baz <| |>
|
36
36
|
EOS
|
37
37
|
end
|
38
38
|
|
39
|
-
it '
|
39
|
+
it 'detects a problems' do
|
40
40
|
expect(problems).to have(1).problems
|
41
41
|
end
|
42
42
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,28 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'simplecov'
|
5
|
+
require 'simplecov-console'
|
6
|
+
require 'codecov'
|
7
|
+
rescue LoadError
|
8
|
+
else
|
9
|
+
SimpleCov.start do
|
10
|
+
track_files 'lib/**/*.rb'
|
11
|
+
|
12
|
+
add_filter '/spec'
|
13
|
+
|
14
|
+
enable_coverage :branch
|
15
|
+
|
16
|
+
# do not track vendored files
|
17
|
+
add_filter '/vendor'
|
18
|
+
add_filter '/.vendor'
|
19
|
+
end
|
20
|
+
|
21
|
+
SimpleCov.formatters = [
|
22
|
+
SimpleCov::Formatter::Console,
|
23
|
+
SimpleCov::Formatter::Codecov,
|
24
|
+
]
|
25
|
+
end
|
3
26
|
|
4
27
|
require 'puppet-lint'
|
5
28
|
|
metadata
CHANGED
@@ -1,57 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-spaceship_operator_without_tag-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-28 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
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '1.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
34
|
+
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '13.0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '13.0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
48
|
+
name: rspec
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '3.0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '3.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rspec-collection_matchers
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +73,7 @@ dependencies:
|
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: '1.0'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
76
|
+
name: rspec-its
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
@@ -81,36 +87,22 @@ dependencies:
|
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '1.0'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
90
|
+
name: simplecov
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
93
|
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
95
|
+
version: 0.22.0
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
100
|
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
-
|
98
|
-
|
99
|
-
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
description: |2
|
112
|
-
A puppet-lint plugin to check that spaceship operator is called with a tag.
|
113
|
-
email: mickael.canevet@camptocamp.com
|
102
|
+
version: 0.22.0
|
103
|
+
description: " A puppet-lint plugin to check that spaceship operator is called
|
104
|
+
with a tag.\n"
|
105
|
+
email: voxpupuli@groups.io
|
114
106
|
executables: []
|
115
107
|
extensions: []
|
116
108
|
extra_rdoc_files: []
|
@@ -120,7 +112,7 @@ files:
|
|
120
112
|
- lib/puppet-lint/plugins/check_spaceship_operator_without_tag.rb
|
121
113
|
- spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb
|
122
114
|
- spec/spec_helper.rb
|
123
|
-
homepage: https://github.com/
|
115
|
+
homepage: https://github.com/voxupuli/puppet-lint-spaceship_operator_without_tag-check
|
124
116
|
licenses:
|
125
117
|
- Apache-2.0
|
126
118
|
metadata: {}
|
@@ -132,18 +124,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
124
|
requirements:
|
133
125
|
- - ">="
|
134
126
|
- !ruby/object:Gem::Version
|
135
|
-
version: '
|
127
|
+
version: '2.7'
|
128
|
+
- - "<"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '4'
|
136
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
132
|
requirements:
|
138
133
|
- - ">="
|
139
134
|
- !ruby/object:Gem::Version
|
140
135
|
version: '0'
|
141
136
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.2.2
|
137
|
+
rubygems_version: 3.2.33
|
144
138
|
signing_key:
|
145
139
|
specification_version: 4
|
146
140
|
summary: A puppet-lint plugin to check that spaceship operator is called with a tag.
|
147
|
-
test_files:
|
148
|
-
- spec/spec_helper.rb
|
149
|
-
- spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb
|
141
|
+
test_files: []
|