puppet-lint-racism_terminology-check 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 +7 -0
- data/LICENSE +13 -0
- data/README.md +13 -0
- data/lib/puppet-lint/plugins/check_racism_terminology.rb +25 -0
- data/lib/puppet-lint/plugins/racism_terminology.rb +22 -0
- data/spec/puppet-lint/plugins/check_racism_terminology_spec.rb +47 -0
- data/spec/spec_helper.rb +3 -0
- metadata +171 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 700b7652d5e6806ae24fa6de70ab45977e6300056c1268a288a77bbf327e79dc
|
4
|
+
data.tar.gz: 7bfc0068fb8b443d5a70455148c0133cdbec61edbb054b419d6938e1b832e0cd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 95045d0365c5449dd2354372db2f7fe69615df901cf22948eb948bd2c17bda7641be1e90f3f1fc5b9a98ee75ed98e55e02a0246d60638b4e2934ae9227e62344
|
7
|
+
data.tar.gz: 0ae443f6daada72bba37642441c54db1a0758117786f7d98dc273ff444d840233e80309fbbff6d7831e0aa1a04da88898b579d47ed20a406035e4b68271a09a4
|
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (C) 2013- Tim Skirvin <tskirvin@fnal.gov>
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# puppet-lint racism_terminology check
|
2
|
+
|
3
|
+
A puppet-lint extension that offers warnings when you include words that
|
4
|
+
have a racist history: 'master/slave', 'whitelist/blacklist', for
|
5
|
+
starters. See: <https://tools.ietf.org/id/draft-knodel-terminology-01.html>
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
`gem install puppet-lint-racism_terminology-check`
|
10
|
+
|
11
|
+
### Author
|
12
|
+
|
13
|
+
[Tim Skirvin](http://wiki.killfile.org/)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
PuppetLint.new_check(:racism_terminology) do
|
2
|
+
# rubocop:disable Style/Next
|
3
|
+
def check
|
4
|
+
manifest_lines.each_with_index do |line, idx|
|
5
|
+
if line =~ /\b(master|slave)\b/
|
6
|
+
notify(
|
7
|
+
:warning,
|
8
|
+
message: 'master/slave terminology, perhaps leader/follower?',
|
9
|
+
line: idx + 1,
|
10
|
+
column: line.length
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
if line =~ /\b(blacklist|whitelist)\b/
|
15
|
+
notify(
|
16
|
+
:warning,
|
17
|
+
message: 'blacklist/whitelist terminology, perhaps blocklist/approvelist?',
|
18
|
+
line: idx + 1,
|
19
|
+
column: line.length
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
# rubocop:enable Style/Next
|
25
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
PuppetLint.new_check(:racism_terminology) do
|
2
|
+
def check
|
3
|
+
manifest_lines.each_with_index do |line, idx|
|
4
|
+
if line =~ %r{/(master|slave)/w}
|
5
|
+
notify(
|
6
|
+
warning,
|
7
|
+
message: 'master/slave terminology, perhaps leader/follower?',
|
8
|
+
line: idx + 1,
|
9
|
+
column: 1
|
10
|
+
)
|
11
|
+
end
|
12
|
+
if line =~ %r{/(blacklist|whitelist)/w}
|
13
|
+
notify(
|
14
|
+
warning,
|
15
|
+
message: 'blacklist/whitelist terminology, perhaps blocklist/approvelist?',
|
16
|
+
line: idx + 1,
|
17
|
+
column: 1
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'racism_terminology' do
|
4
|
+
context 'clean' do
|
5
|
+
let(:code) { "file { '/tmp/boring': }" }
|
6
|
+
|
7
|
+
it 'should detect no problems' do
|
8
|
+
is_expected.to have(0).problems
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'master' do
|
13
|
+
let(:code) { "file { '/tmp/master': }" }
|
14
|
+
let(:msg) { 'master/slave terminology, perhaps leader/follower?' }
|
15
|
+
|
16
|
+
it 'should create a warning' do
|
17
|
+
expect(problems).to contain_warning(msg).on_line(1)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'slave' do
|
22
|
+
let(:code) { "file { '/tmp/slave': }" }
|
23
|
+
let(:msg) { 'master/slave terminology, perhaps leader/follower?' }
|
24
|
+
|
25
|
+
it 'should create a warning' do
|
26
|
+
expect(problems).to contain_warning(msg).on_line(1)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'whitelist' do
|
31
|
+
let(:code) { "file { '/tmp/whitelist': }" }
|
32
|
+
let(:msg) { 'blacklist/whitelist terminology, perhaps blocklist/approvelist?' }
|
33
|
+
|
34
|
+
it 'should create a warning' do
|
35
|
+
expect(problems).to contain_warning(msg).on_line(1)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'blacklist' do
|
40
|
+
let(:code) { "file { '/tmp/blacklist': }" }
|
41
|
+
let(:msg) { 'blacklist/whitelist terminology, perhaps blocklist/approvelist?' }
|
42
|
+
|
43
|
+
it 'should create a warning' do
|
44
|
+
expect(problems).to contain_warning(msg).on_line(1)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: puppet-lint-racism_terminology-check
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tim Skirvin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: puppet-lint
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rake
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec-collection_matchers
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec-its
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec-json_expectations
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2.2'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '2.2'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rubocop
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.85.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.85.0
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: simplecov
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.18.0
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 0.18.0
|
131
|
+
description: |2
|
132
|
+
A puppet-lint extension that warns when you use racist terminology
|
133
|
+
in your code. Starting terms: whitelist, blacklist, master, slave
|
134
|
+
email: tskirvin@fnal.gov
|
135
|
+
executables: []
|
136
|
+
extensions: []
|
137
|
+
extra_rdoc_files: []
|
138
|
+
files:
|
139
|
+
- LICENSE
|
140
|
+
- README.md
|
141
|
+
- lib/puppet-lint/plugins/check_racism_terminology.rb
|
142
|
+
- lib/puppet-lint/plugins/racism_terminology.rb
|
143
|
+
- spec/puppet-lint/plugins/check_racism_terminology_spec.rb
|
144
|
+
- spec/spec_helper.rb
|
145
|
+
homepage: https://github.com/tskirvin/puppet-lint-racism_terminology-check
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata: {}
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.7.6.2
|
166
|
+
signing_key:
|
167
|
+
specification_version: 4
|
168
|
+
summary: puppet-lint racism terminology check
|
169
|
+
test_files:
|
170
|
+
- spec/puppet-lint/plugins/check_racism_terminology_spec.rb
|
171
|
+
- spec/spec_helper.rb
|