puppet-lint-file_ensure-check 0.2.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 +5 -5
- data/README.md +43 -5
- data/lib/puppet-lint/plugins/check_file_ensure.rb +11 -12
- data/spec/puppet-lint/plugins/check_file_ensure/check_file_ensure_spec.rb +20 -0
- data/spec/spec_helper.rb +25 -2
- metadata +25 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 51b0ede786ff01cca71b84fcae04321a10facbaf5fce60719b4f25beeb158f5b
|
4
|
+
data.tar.gz: 5156be528b986222ad588414cefdc359edbde1a536c91fd0c72beb907f129843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54690c5c649b77a713544b57a2cfc1abb4cfd4e97601a2a3d4d4616a8b2c9ed7b60125b44fe449ed08863e91cd15c5c718ba77e2c0077d67d95384496abd63a2
|
7
|
+
data.tar.gz: 8cd362c8f9d8906d325fc1370dd6697332be0593de59a9917119327bf20406672bd80f47c2db039bfef45a7676339b4b1de8b99e0cd08a3477b356571f044985
|
data/README.md
CHANGED
@@ -1,13 +1,29 @@
|
|
1
1
|
puppet-lint-file_ensure-check
|
2
|
-
|
2
|
+
==============================
|
3
3
|
|
4
|
-
[](https://github.com/voxpupuli/puppet-lint-file_ensure-check/blob/master/LICENSE)
|
5
|
+
[](https://github.com/voxpupuli/puppet-lint-file_ensure-check/actions/workflows/test.yml)
|
6
|
+
[](https://github.com/voxpupuli/puppet-lint-file_ensure-check/actions/workflows/release.yml)
|
7
|
+
[](https://rubygems.org/gems/puppet-lint-file_ensure-check)
|
8
|
+
[](https://rubygems.org/gems/puppet-lint-file_ensure-check)
|
9
|
+
[](#transfer-notice)
|
10
|
+
[](https://codecov.io/gh/voxpupuli/puppet-lint-file_ensure-check)
|
8
11
|
|
9
12
|
A puppet-lint plugin to check the ensure attribute on file resources.
|
10
13
|
|
14
|
+
## Installing
|
15
|
+
|
16
|
+
### From the command line
|
17
|
+
|
18
|
+
```shell
|
19
|
+
$ gem install puppet-lint-file_ensure-check
|
20
|
+
```
|
21
|
+
|
22
|
+
### In a Gemfile
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
gem 'puppet-lint-file_ensure-check', :require => false
|
26
|
+
```
|
11
27
|
|
12
28
|
## Checks
|
13
29
|
|
@@ -45,3 +61,25 @@ Alternatively, if you’re calling puppet-lint via the Rake task, you should ins
|
|
45
61
|
```ruby
|
46
62
|
PuppetLint.configuration.send('disable_file_ensure')
|
47
63
|
```
|
64
|
+
|
65
|
+
## Transfer Notice
|
66
|
+
|
67
|
+
This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
|
68
|
+
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
|
69
|
+
Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.
|
70
|
+
|
71
|
+
Previously: https://github.com/camptocamp/puppet-lint-file_ensure-check
|
72
|
+
|
73
|
+
## License
|
74
|
+
|
75
|
+
This gem is licensed under the Apache-2 license.
|
76
|
+
|
77
|
+
## Release information
|
78
|
+
|
79
|
+
To make a new release, please do:
|
80
|
+
* update the version in the gemspec file
|
81
|
+
* Install gems with `bundle install --with release --path .vendor`
|
82
|
+
* generate the changelog with `bundle exec rake changelog`
|
83
|
+
* Check if the new version matches the closed issues/PRs in the changelog
|
84
|
+
* Create a PR with it
|
85
|
+
* After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
|
@@ -5,18 +5,17 @@ PuppetLint.new_check(:file_ensure) do
|
|
5
5
|
attr = resource[:tokens].select { |t| t.type == :NAME && \
|
6
6
|
t.value == 'ensure' && \
|
7
7
|
t.next_code_token.type == :FARROW }
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
8
|
+
next if attr.empty?
|
9
|
+
val_token = attr[0].next_code_token.next_code_token
|
10
|
+
next unless val_token.value == 'present'
|
11
|
+
next unless [:NAME, :STRING, :SSTRING].include? val_token.type
|
12
|
+
notify :warning, {
|
13
|
+
:message => 'ensure set to present on file resource',
|
14
|
+
:line => val_token.line,
|
15
|
+
:column => val_token.column,
|
16
|
+
:token => val_token,
|
17
|
+
:resource => resource,
|
18
|
+
}
|
20
19
|
end
|
21
20
|
end
|
22
21
|
end
|
@@ -15,6 +15,10 @@ describe 'file_ensure' do
|
|
15
15
|
ensure => 'target',
|
16
16
|
target => '/etc/mtab',
|
17
17
|
}
|
18
|
+
|
19
|
+
file { '/tmp/foo':
|
20
|
+
ensure => $present,
|
21
|
+
}
|
18
22
|
EOS
|
19
23
|
}
|
20
24
|
|
@@ -34,6 +38,10 @@ describe 'file_ensure' do
|
|
34
38
|
ensure => 'present',
|
35
39
|
target => '/etc/mtab',
|
36
40
|
}
|
41
|
+
|
42
|
+
file { '/tmp/foo':
|
43
|
+
ensure => $present,
|
44
|
+
}
|
37
45
|
EOS
|
38
46
|
}
|
39
47
|
|
@@ -68,6 +76,10 @@ describe 'file_ensure' do
|
|
68
76
|
ensure => 'target',
|
69
77
|
target => '/etc/mtab',
|
70
78
|
}
|
79
|
+
|
80
|
+
file { '/tmp/foo':
|
81
|
+
ensure => $present,
|
82
|
+
}
|
71
83
|
EOS
|
72
84
|
}
|
73
85
|
|
@@ -91,6 +103,10 @@ describe 'file_ensure' do
|
|
91
103
|
ensure => 'present',
|
92
104
|
target => '/etc/mtab',
|
93
105
|
}
|
106
|
+
|
107
|
+
file { '/tmp/foo':
|
108
|
+
ensure => $present,
|
109
|
+
}
|
94
110
|
EOS
|
95
111
|
}
|
96
112
|
|
@@ -114,6 +130,10 @@ describe 'file_ensure' do
|
|
114
130
|
ensure => 'link',
|
115
131
|
target => '/etc/mtab',
|
116
132
|
}
|
133
|
+
|
134
|
+
file { '/tmp/foo':
|
135
|
+
ensure => $present,
|
136
|
+
}
|
117
137
|
EOS
|
118
138
|
)
|
119
139
|
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,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-file_ensure-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: 2021-09-17 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: '3.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: '3.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rspec
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,30 +76,30 @@ dependencies:
|
|
70
76
|
name: mime-types
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- - "
|
79
|
+
- - ">="
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
81
|
+
version: '0'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
|
-
- - "
|
86
|
+
- - ">="
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
88
|
+
version: '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: '0
|
95
|
+
version: '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: '0
|
102
|
+
version: '0'
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: rake
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,9 +114,8 @@ dependencies:
|
|
108
114
|
- - ">="
|
109
115
|
- !ruby/object:Gem::Version
|
110
116
|
version: '0'
|
111
|
-
description:
|
112
|
-
|
113
|
-
email: raphael.pinson@camptocamp.com
|
117
|
+
description: " A puppet-lint plugin to check the ensure attribute on file resources.\n"
|
118
|
+
email: voxpupuli@groups.io
|
114
119
|
executables: []
|
115
120
|
extensions: []
|
116
121
|
extra_rdoc_files: []
|
@@ -120,7 +125,7 @@ files:
|
|
120
125
|
- lib/puppet-lint/plugins/check_file_ensure.rb
|
121
126
|
- spec/puppet-lint/plugins/check_file_ensure/check_file_ensure_spec.rb
|
122
127
|
- spec/spec_helper.rb
|
123
|
-
homepage: https://github.com/
|
128
|
+
homepage: https://github.com/voxpupuli/puppet-lint-file_ensure-check
|
124
129
|
licenses:
|
125
130
|
- Apache-2.0
|
126
131
|
metadata: {}
|
@@ -139,11 +144,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
144
|
- !ruby/object:Gem::Version
|
140
145
|
version: '0'
|
141
146
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.2.2
|
147
|
+
rubygems_version: 3.2.22
|
144
148
|
signing_key:
|
145
149
|
specification_version: 4
|
146
150
|
summary: A puppet-lint plugin to check the ensure attribute on file resources.
|
147
151
|
test_files:
|
148
|
-
- spec/spec_helper.rb
|
149
152
|
- spec/puppet-lint/plugins/check_file_ensure/check_file_ensure_spec.rb
|
153
|
+
- spec/spec_helper.rb
|