Skip to content

Commit 5b90f03

Browse files
committed
Move to PDK
1 parent 04a82d8 commit 5b90f03

9 files changed

Lines changed: 483 additions & 156 deletions

File tree

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.rb eol=lf
2+
*.erb eol=lf
3+
*.pp eol=lf
4+
*.sh eol=lf
5+
*.epp eol=lf

.gitignore

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
1-
pkg/*
1+
.git/
2+
.*.sw[op]
3+
.metadata
4+
.yardoc
5+
.yardwarns
6+
*.iml
7+
/.bundle/
8+
/.idea/
9+
/.vagrant/
10+
/coverage/
11+
/bin/
12+
/doc/
13+
/Gemfile.local
14+
/junit/
15+
/log/
16+
/pkg/
17+
/tmp/
18+
/vendor/
19+
/convert_report.txt
20+
/update_report.txt
221
spec/fixtures
322
.rspec_system
4-
.bundle
5-
vendor
623

724
.rbenv-gemsets
825
.ruby-version
926

1027
tests/centos/.vagrant
1128
tests/ubuntu/.vagrant
1229

13-
# mac stuff
1430
.DS_Store
31+
.project
32+
.envrc
33+
/inventory.yaml

.pdkignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.git/
2+
.*.sw[op]
3+
.metadata
4+
.yardoc
5+
.yardwarns
6+
*.iml
7+
/.bundle/
8+
/.idea/
9+
/.vagrant/
10+
/coverage/
11+
/bin/
12+
/doc/
13+
/Gemfile.local
14+
/Gemfile.lock
15+
/junit/
16+
/log/
17+
/pkg/
18+
/spec/fixtures/manifests/
19+
/spec/fixtures/modules/
20+
/tmp/
21+
/vendor/
22+
/convert_report.txt
23+
/update_report.txt
24+
.DS_Store
25+
.project
26+
.envrc
27+
/inventory.yaml
28+
/appveyor.yml
29+
/.fixtures.yml
30+
/Gemfile
31+
/.gitattributes
32+
/.gitignore
33+
/.gitlab-ci.yml
34+
/.pdkignore
35+
/Rakefile
36+
/rakelib/
37+
/.rspec
38+
/.rubocop.yml
39+
/.travis.yml
40+
/.yardopts
41+
/spec/
42+
/.vscode/
43+
/tests/

.puppet-lint.rc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--relative
2+
--no-140chars-check
3+
--fail-on-warnings

.rubocop.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
require:
3+
- rubocop-rspec
4+
- rubocop-i18n
5+
AllCops:
6+
DisplayCopNames: true
7+
TargetRubyVersion: '2.1'
8+
Include:
9+
- "./**/*.rb"
10+
Exclude:
11+
- bin/*
12+
- ".vendor/**/*"
13+
- "**/Gemfile"
14+
- "**/Rakefile"
15+
- pkg/**/*
16+
- spec/fixtures/**/*
17+
- vendor/**/*
18+
- "**/Puppetfile"
19+
- "**/Vagrantfile"
20+
- "**/Guardfile"
21+
Metrics/LineLength:
22+
Description: People have wide screens, use them.
23+
Max: 200
24+
GetText:
25+
Enabled: false
26+
GetText/DecorateString:
27+
Description: We don't want to decorate test output.
28+
Exclude:
29+
- spec/**/*
30+
Enabled: false
31+
RSpec/BeforeAfterAll:
32+
Description: Beware of using after(:all) as it may cause state to leak between tests.
33+
A necessary evil in acceptance testing.
34+
Exclude:
35+
- spec/acceptance/**/*.rb
36+
RSpec/HookArgument:
37+
Description: Prefer explicit :each argument, matching existing module's style
38+
EnforcedStyle: each
39+
Style/BlockDelimiters:
40+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
41+
be consistent then.
42+
EnforcedStyle: braces_for_chaining
43+
Style/ClassAndModuleChildren:
44+
Description: Compact style reduces the required amount of indentation.
45+
EnforcedStyle: compact
46+
Style/EmptyElse:
47+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
48+
EnforcedStyle: empty
49+
Style/FormatString:
50+
Description: Following the main puppet project's style, prefer the % format format.
51+
EnforcedStyle: percent
52+
Style/FormatStringToken:
53+
Description: Following the main puppet project's style, prefer the simpler template
54+
tokens over annotated ones.
55+
EnforcedStyle: template
56+
Style/Lambda:
57+
Description: Prefer the keyword for easier discoverability.
58+
EnforcedStyle: literal
59+
Style/RegexpLiteral:
60+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
61+
EnforcedStyle: percent_r
62+
Style/TernaryParentheses:
63+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
64+
on complex expressions for better readability, but seriously consider breaking
65+
it up.
66+
EnforcedStyle: require_parentheses_when_complex
67+
Style/TrailingCommaInArguments:
68+
Description: Prefer always trailing comma on multiline argument lists. This makes
69+
diffs, and re-ordering nicer.
70+
EnforcedStyleForMultiline: comma
71+
Style/TrailingCommaInLiteral:
72+
Description: Prefer always trailing comma on multiline literals. This makes diffs,
73+
and re-ordering nicer.
74+
EnforcedStyleForMultiline: comma
75+
Style/SymbolArray:
76+
Description: Using percent style obscures symbolic intent of array's contents.
77+
EnforcedStyle: brackets
78+
RSpec/MessageSpies:
79+
EnforcedStyle: receive
80+
Style/Documentation:
81+
Exclude:
82+
- lib/puppet/parser/functions/**/*
83+
- spec/**/*
84+
Style/WordArray:
85+
EnforcedStyle: brackets
86+
Style/CollectionMethods:
87+
Enabled: true
88+
Style/MethodCalledOnDoEndBlock:
89+
Enabled: true
90+
Style/StringMethods:
91+
Enabled: true
92+
GetText/DecorateFunctionMessage:
93+
Enabled: false
94+
GetText/DecorateStringFormattingUsingInterpolation:
95+
Enabled: false
96+
GetText/DecorateStringFormattingUsingPercent:
97+
Enabled: false
98+
Layout/EndOfLine:
99+
Enabled: false
100+
Layout/IndentHeredoc:
101+
Enabled: false
102+
Metrics/AbcSize:
103+
Enabled: false
104+
Metrics/BlockLength:
105+
Enabled: false
106+
Metrics/ClassLength:
107+
Enabled: false
108+
Metrics/CyclomaticComplexity:
109+
Enabled: false
110+
Metrics/MethodLength:
111+
Enabled: false
112+
Metrics/ModuleLength:
113+
Enabled: false
114+
Metrics/ParameterLists:
115+
Enabled: false
116+
Metrics/PerceivedComplexity:
117+
Enabled: false
118+
RSpec/DescribeClass:
119+
Enabled: false
120+
RSpec/ExampleLength:
121+
Enabled: false
122+
RSpec/MessageExpectation:
123+
Enabled: false
124+
RSpec/MultipleExpectations:
125+
Enabled: false
126+
RSpec/NestedGroups:
127+
Enabled: false
128+
Style/AsciiComments:
129+
Enabled: false
130+
Style/IfUnlessModifier:
131+
Enabled: false
132+
Style/SymbolProc:
133+
Enabled: false

Gemfile

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
source "https://rubygems.org"
22

3-
group :test do
4-
gem "rb-inotify", '< 0.10.0' if RUBY_VERSION < '2.2.0'
5-
gem "public_suffix", "~> 3.0.0"
6-
gem "listen", "~> 3.0.0"
7-
# Puppet 4.10.2 is the minimum version we support on Windows due to https://tickets.puppetlabs.com/browse/PUP-7383
8-
# On Linux we support down to 4.6
9-
gem "puppet", "~> #{ENV.fetch('PUPPET_VERSION', '4.10.2')}"
10-
gem "puppet-lint", "~> 2.3.6"
11-
gem "puppet-syntax", "~> 2.5.0"
12-
gem "puppetlabs_spec_helper", "~> 2.14.1"
13-
gem "jwt", "~> 1.5.6"
14-
gem "rake", "~> 12.3.3" # last version to support ruby < 2.6
15-
gem "rspec-puppet", '2.6.9'
16-
gem "ruby-pwsh", '~> 0.3.0', platforms: [:mswin, :mingw, :x64_mingw]
17-
end
3+
# Puppet 4.10.2 is the minimum version we support on Windows due to https://tickets.puppetlabs.com/browse/PUP-7383
4+
# On Linux we support down to 4.6
5+
gem "puppet", "~> #{ENV.fetch('PUPPET_VERSION', '4.10.2')}"
6+
7+
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
8+
minor_version = ruby_version_segments[0..1].join('.')
189

1910
group :development do
20-
gem "fog-openstack", "0.1.25" if RUBY_VERSION < '2.2.0'
21-
gem "guard-rake"
22-
gem "mocha", "~> 1.9.0"
23-
gem "rspec-core", "~> 3.8.2"
24-
gem "rspec-expectations", "~> 3.8.4"
25-
gem "rspec-mocks", "~> 3.8.1"
26-
gem "puppet-blacksmith", "~> 4.1.2"
27-
gem "xmlrpc" if RUBY_VERSION >= '2.3'
11+
gem "rake", "~> 12.3.3" if RUBY_VERSION < '2.6.0' # last version for ruby < 2.6
12+
gem "xmlrpc" if RUBY_VERSION >= '2.3'
13+
gem "ruby-pwsh", '~> 0.3.0', platforms: [:mswin, :mingw, :x64_mingw]
14+
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
15+
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
16+
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
17+
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
18+
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
19+
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
20+
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
21+
if RUBY_VERSION >= '2.3'
22+
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
23+
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
24+
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
25+
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
26+
else
27+
gem "puppetlabs_spec_helper", "~> 2.14.1"
28+
gem "puppet-lint", "~> 2.4.2"
29+
gem "metadata-json-lint", "~> 1.2.2"
30+
gem "puppet-syntax", "~> 2.5.0"
31+
gem "rspec-puppet", '2.6.9'
32+
end
2833
end

0 commit comments

Comments
 (0)