puppet-lint-spaceship_operator_without_tag-check 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NjQ5MzZlODIxMmU4MzM0NGM1ZDkwNTAxNGUyMzg5M2UyZjc2NmE1YQ==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2eaa47ef5cb78081f72d872af53d2d194e48760387109f3c641e61e35b8347d9
|
4
|
+
data.tar.gz: cb258cac73e972c42b01ea61df0637734a172c4f92e1d30d163384f92cf5978b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
Y2UzNGJhNTFlZDBjYmJjZDU5ODYxNmI3MmNiNmE5YjdmZTNkYTcxZWMzOGRk
|
11
|
-
MzYxN2VlMzk5YjNiNWE4ZDE1Mjg2ZGU2MTdhNDlhOWY1NzEwOGE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NWVkZGU4MTYyMzBhN2M5OGQzZWViODFmZWQwNzY0ZjBhMzQ4MmRiNzc4NWYx
|
14
|
-
MTJkMTczZTQ0NmFjZDhmM2ZlZTkwOWUyM2M5NGI4MzUzNTk4YzJhOWQ5MTM0
|
15
|
-
NzVmMTQyZGVhODBmMzBlNjY4MjgzMDg4YmNiNDIwM2QxMjgyZGY=
|
6
|
+
metadata.gz: 430cb862ea3ae005d2ef141ca998b6e64ae506310d2864aac96ef842a2e0241fa600b57ab93ac334fc71aa3d058a266d29db3d7d045c3092def958d5816bde79
|
7
|
+
data.tar.gz: a771cc3036835625dc9c2b97bd76f21da4f8237c0f0622dcd18214d2d87f8cbd8c846765a3d6d639c51b24dbb353ce4508e6269a4c9e80c764f27a9fb1766c83
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
puppet-lint-spaceship_operator_without_tag-check
|
2
2
|
================================================
|
3
3
|
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![
|
8
|
-
[![
|
4
|
+
[![License](https://img.shields.io/github/license/voxpupuli/puppet-lint-spaceship_operator_without_tag-check.svg)](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/blob/master/LICENSE)
|
5
|
+
[![Test](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/actions/workflows/test.yml)
|
6
|
+
[![Release](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-spaceship_operator_without_tag-check/actions/workflows/release.yml)
|
7
|
+
[![RubyGem Version](https://img.shields.io/gem/v/puppet-lint-spaceship_operator_without_tag-check.svg)](https://rubygems.org/gems/puppet-lint-spaceship_operator_without_tag-check)
|
8
|
+
[![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-lint-spaceship_operator_without_tag-check.svg)](https://rubygems.org/gems/puppet-lint-spaceship_operator_without_tag-check)
|
9
9
|
[![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)
|
10
10
|
|
11
11
|
A puppet-lint plugin to check that spaceship operator is called with a tag.
|
@@ -33,13 +33,17 @@ Calling spaceship operator (<| |>) without tag can be dangerous because it will
|
|
33
33
|
#### What you have done
|
34
34
|
|
35
35
|
```puppet
|
36
|
-
|
36
|
+
class foo {
|
37
|
+
Package <| |>
|
38
|
+
}
|
37
39
|
```
|
38
40
|
|
39
41
|
#### What you should have done
|
40
42
|
|
41
43
|
```puppet
|
42
|
-
|
44
|
+
class foo {
|
45
|
+
Package <| tag == 'foo' |>
|
46
|
+
}
|
43
47
|
```
|
44
48
|
|
45
49
|
#### Disabling the check
|
@@ -63,3 +67,17 @@ The maintainer preferred that Puppet Community take ownership of the module for
|
|
63
67
|
Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.
|
64
68
|
|
65
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,6 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
+
]
|
4
25
|
end
|
5
26
|
|
6
27
|
require 'puppet-lint'
|
metadata
CHANGED
@@ -1,124 +1,108 @@
|
|
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: 0.
|
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
|
-
- - <
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.0'
|
30
|
-
- - <
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '5.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ~>
|
37
|
+
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '13.0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ~>
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '13.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name: rspec
|
48
|
+
name: rspec
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - ~>
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '3.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - ~>
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '3.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec-collection_matchers
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - ~>
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '1.0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - ~>
|
72
|
+
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '1.0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: rspec-its
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - ~>
|
79
|
+
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '1.0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - ~>
|
86
|
+
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '1.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
90
|
+
name: simplecov
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- - ~>
|
93
|
+
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
95
|
+
version: 0.22.0
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- - ~>
|
100
|
+
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
103
|
-
-
|
104
|
-
|
105
|
-
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - ! '>='
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '0'
|
117
|
-
description: ! ' A puppet-lint plugin to check that spaceship operator is called
|
118
|
-
with a tag.
|
119
|
-
|
120
|
-
'
|
121
|
-
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
|
122
106
|
executables: []
|
123
107
|
extensions: []
|
124
108
|
extra_rdoc_files: []
|
@@ -128,7 +112,7 @@ files:
|
|
128
112
|
- lib/puppet-lint/plugins/check_spaceship_operator_without_tag.rb
|
129
113
|
- spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb
|
130
114
|
- spec/spec_helper.rb
|
131
|
-
homepage: https://github.com/
|
115
|
+
homepage: https://github.com/voxupuli/puppet-lint-spaceship_operator_without_tag-check
|
132
116
|
licenses:
|
133
117
|
- Apache-2.0
|
134
118
|
metadata: {}
|
@@ -138,20 +122,20 @@ require_paths:
|
|
138
122
|
- lib
|
139
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
124
|
requirements:
|
141
|
-
- -
|
125
|
+
- - ">="
|
142
126
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
127
|
+
version: '2.7'
|
128
|
+
- - "<"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '4'
|
144
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
132
|
requirements:
|
146
|
-
- -
|
133
|
+
- - ">="
|
147
134
|
- !ruby/object:Gem::Version
|
148
135
|
version: '0'
|
149
136
|
requirements: []
|
150
|
-
|
151
|
-
rubygems_version: 2.4.5
|
137
|
+
rubygems_version: 3.2.33
|
152
138
|
signing_key:
|
153
139
|
specification_version: 4
|
154
140
|
summary: A puppet-lint plugin to check that spaceship operator is called with a tag.
|
155
|
-
test_files:
|
156
|
-
- spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb
|
157
|
-
- spec/spec_helper.rb
|
141
|
+
test_files: []
|