Skip to content

Commit d9d6a93

Browse files
authored
Convert module to use pdk (#63)
* first shot at using pdk * tests->examples * 👮 * 👮 * redhat * 👮 * oops
1 parent 5e2987e commit d9d6a93

33 files changed

Lines changed: 918 additions & 454 deletions
File renamed without changes.

.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: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1-
Gemfile.lock
2-
*.swp
3-
.librarian/
4-
.tmp/
5-
.vagrant
6-
modules/
7-
pkg/*
8-
spec/fixtures/manifests/
9-
spec/fixtures/modules/
1+
.git/
2+
.*.sw[op]
3+
.metadata
4+
.tmp
5+
.yardoc
6+
.yardwarns
7+
*.iml
8+
/.bundle/
9+
/.idea/
10+
/.vagrant/
11+
/coverage/
12+
/bin/
13+
/doc/
14+
/Gemfile.local
15+
/Gemfile.lock
16+
/junit/
17+
/log/
18+
/pkg/
19+
/spec/fixtures/manifests/
20+
/spec/fixtures/modules/
21+
/tmp/
22+
/vendor/
23+
/convert_report.txt
24+
/update_report.txt
25+
.DS_Store
26+
.project
27+
.envrc
28+
/inventory.yaml

.gitlab-ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
stages:
3+
- syntax
4+
- unit
5+
6+
cache:
7+
paths:
8+
- vendor/bundle
9+
10+
before_script:
11+
- bundle -v
12+
- rm Gemfile.lock || true
13+
- gem update --system $RUBYGEMS_VERSION
14+
- gem --version
15+
- bundle -v
16+
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
17+
18+
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.3-Puppet ~> 6:
19+
stage: syntax
20+
image: ruby:2.5.3
21+
script:
22+
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
23+
variables:
24+
PUPPET_GEM_VERSION: '~> 6'
25+
26+
parallel_spec-Ruby 2.5.3-Puppet ~> 6:
27+
stage: unit
28+
image: ruby:2.5.3
29+
script:
30+
- bundle exec rake parallel_spec
31+
variables:
32+
PUPPET_GEM_VERSION: '~> 6'
33+
34+
parallel_spec-Ruby 2.4.5-Puppet ~> 5:
35+
stage: unit
36+
image: ruby:2.4.5
37+
script:
38+
- bundle exec rake parallel_spec
39+
variables:
40+
PUPPET_GEM_VERSION: '~> 5'
41+

.librarian/puppet/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
LIBRARIAN_PUPPET_DESTRUCTIVE: 'false'
3+
LIBRARIAN_PUPPET_USE_V1_API: '1'

.pdkignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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/

.puppet-lint.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--relative

.puppet3.fixtures.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

.rubocop.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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+
RSpec/BeforeAfterAll:
31+
Description: Beware of using after(:all) as it may cause state to leak between tests.
32+
A necessary evil in acceptance testing.
33+
Exclude:
34+
- spec/acceptance/**/*.rb
35+
RSpec/HookArgument:
36+
Description: Prefer explicit :each argument, matching existing module's style
37+
EnforcedStyle: each
38+
Style/BlockDelimiters:
39+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
40+
be consistent then.
41+
EnforcedStyle: braces_for_chaining
42+
Style/ClassAndModuleChildren:
43+
Description: Compact style reduces the required amount of indentation.
44+
EnforcedStyle: compact
45+
Style/EmptyElse:
46+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
47+
EnforcedStyle: empty
48+
Style/FormatString:
49+
Description: Following the main puppet project's style, prefer the % format format.
50+
EnforcedStyle: percent
51+
Style/FormatStringToken:
52+
Description: Following the main puppet project's style, prefer the simpler template
53+
tokens over annotated ones.
54+
EnforcedStyle: template
55+
Style/Lambda:
56+
Description: Prefer the keyword for easier discoverability.
57+
EnforcedStyle: literal
58+
Style/RegexpLiteral:
59+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
60+
EnforcedStyle: percent_r
61+
Style/TernaryParentheses:
62+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
63+
on complex expressions for better readability, but seriously consider breaking
64+
it up.
65+
EnforcedStyle: require_parentheses_when_complex
66+
Style/TrailingCommaInArguments:
67+
Description: Prefer always trailing comma on multiline argument lists. This makes
68+
diffs, and re-ordering nicer.
69+
EnforcedStyleForMultiline: comma
70+
Style/TrailingCommaInLiteral:
71+
Description: Prefer always trailing comma on multiline literals. This makes diffs,
72+
and re-ordering nicer.
73+
EnforcedStyleForMultiline: comma
74+
Style/SymbolArray:
75+
Description: Using percent style obscures symbolic intent of array's contents.
76+
EnforcedStyle: brackets
77+
RSpec/MessageSpies:
78+
EnforcedStyle: receive
79+
Style/Documentation:
80+
Exclude:
81+
- lib/puppet/parser/functions/**/*
82+
- spec/**/*
83+
Style/WordArray:
84+
EnforcedStyle: brackets
85+
Style/CollectionMethods:
86+
Enabled: true
87+
Style/MethodCalledOnDoEndBlock:
88+
Enabled: true
89+
Style/StringMethods:
90+
Enabled: true
91+
Layout/EndOfLine:
92+
Enabled: false
93+
Layout/IndentHeredoc:
94+
Enabled: false
95+
Metrics/AbcSize:
96+
Enabled: false
97+
Metrics/BlockLength:
98+
Enabled: false
99+
Metrics/ClassLength:
100+
Enabled: false
101+
Metrics/CyclomaticComplexity:
102+
Enabled: false
103+
Metrics/MethodLength:
104+
Enabled: false
105+
Metrics/ModuleLength:
106+
Enabled: false
107+
Metrics/ParameterLists:
108+
Enabled: false
109+
Metrics/PerceivedComplexity:
110+
Enabled: false
111+
RSpec/DescribeClass:
112+
Enabled: false
113+
RSpec/ExampleLength:
114+
Enabled: false
115+
RSpec/MessageExpectation:
116+
Enabled: false
117+
RSpec/MultipleExpectations:
118+
Enabled: false
119+
RSpec/NestedGroups:
120+
Enabled: false
121+
Style/AsciiComments:
122+
Enabled: false
123+
Style/IfUnlessModifier:
124+
Enabled: false
125+
Style/SymbolProc:
126+
Enabled: false

0 commit comments

Comments
 (0)