Skip to content

Commit 9afc809

Browse files
florindragosdavejrt
authored andcommitted
Enable PDK compliance (puppetlabs#389)
* Enable PDK compliance * Add puppet 6 to travis build matrix
1 parent 1510eee commit 9afc809

40 files changed

+593
-313
lines changed

.gitattributes

+5
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

+22-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
spec/fixtures/manifests/
2-
spec/fixtures/modules/
3-
pkg
4-
.bundle/
5-
.vagrant
1+
.git/
2+
.*.sw[op]
3+
.metadata
64
.yardoc
7-
doc
8-
.idea/
9-
*.swp
10-
.ruby-version
11-
log
12-
Gemfile.lock
13-
coverage/*
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/
1421
/vendor/
22+
/convert_report.txt
23+
/update_report.txt
24+
.DS_Store

.pdkignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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

.rspec

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
--color
12
--format documentation

.rubocop.yml

+38-45
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
---
2-
require:
3-
- rubocop-rspec
4-
- rubocop-i18n
2+
require: rubocop-rspec
53
AllCops:
6-
TargetRubyVersion: '2.1'
4+
DisplayCopNames: true
5+
TargetRubyVersion: '2.3'
76
Include:
87
- "./**/*.rb"
98
Exclude:
109
- bin/*
1110
- ".vendor/**/*"
12-
- Gemfile
13-
- Rakefile
11+
- "**/Gemfile"
12+
- "**/Rakefile"
1413
- pkg/**/*
1514
- spec/fixtures/**/*
15+
- spec/classes/**/*
16+
- spec/acceptance/**/*
17+
- spec/acceptance_swarm/**/*
18+
- spec/defines/**/*
19+
- spec/unit/**/*
1620
- vendor/**/*
21+
- "**/Puppetfile"
22+
- "**/Vagrantfile"
23+
- "**/Guardfile"
1724
Metrics/LineLength:
1825
Description: People have wide screens, use them.
1926
Max: 200
20-
Enabled: false
27+
GetText/DecorateString:
28+
Description: We don't want to decorate test output.
29+
Exclude:
30+
- spec/*
2131
RSpec/BeforeAfterAll:
2232
Description: Beware of using after(:all) as it may cause state to leak between tests.
2333
A necessary evil in acceptance testing.
2434
Exclude:
2535
- spec/acceptance/**/*.rb
26-
- spec/acceptance_swarm/**/*.rb
2736
RSpec/HookArgument:
2837
Description: Prefer explicit :each argument, matching existing module's style
2938
EnforcedStyle: each
@@ -40,26 +49,13 @@ Style/EmptyElse:
4049
Style/FormatString:
4150
Description: Following the main puppet project's style, prefer the % format format.
4251
EnforcedStyle: percent
43-
Exclude:
44-
- lib/puppet/provider/docker_volume/ruby.rb
45-
- lib/puppet/provider/docker_network/ruby.rb
46-
- lib/puppet/parser/functions/docker_secrets_flags.rb
47-
- lib/puppet/parser/functions/docker_run_flags.rb
48-
- lib/puppet/type/docker_network.rb
49-
- lib/puppet/type/docker_volume.rb
5052
Style/FormatStringToken:
5153
Description: Following the main puppet project's style, prefer the simpler template
5254
tokens over annotated ones.
5355
EnforcedStyle: template
5456
Style/Lambda:
5557
Description: Prefer the keyword for easier discoverability.
5658
EnforcedStyle: literal
57-
Enabled: true
58-
Exclude:
59-
- lib/puppet/provider/docker_volume/ruby.rb
60-
- lib/puppet/parser/functions/docker_secrets_flags.rb
61-
- lib/puppet/parser/functions/docker_run_flags.rb
62-
- lib/puppet/provider/docker_network/ruby.rb
6359
Style/RegexpLiteral:
6460
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
6561
EnforcedStyle: percent_r
@@ -79,18 +75,28 @@ Style/TrailingCommaInLiteral:
7975
Style/SymbolArray:
8076
Description: Using percent style obscures symbolic intent of array's contents.
8177
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
8286
Style/CollectionMethods:
8387
Enabled: true
8488
Style/MethodCalledOnDoEndBlock:
8589
Enabled: true
8690
Style/StringMethods:
8791
Enabled: true
92+
Layout/EndOfLine:
93+
Enabled: false
94+
Layout/IndentHeredoc:
95+
Enabled: false
8896
Metrics/AbcSize:
8997
Enabled: false
9098
Metrics/BlockLength:
9199
Enabled: false
92-
Metrics/LineLength:
93-
Enabled: false
94100
Metrics/ClassLength:
95101
Enabled: false
96102
Metrics/CyclomaticComplexity:
@@ -105,34 +111,21 @@ Metrics/PerceivedComplexity:
105111
Enabled: false
106112
RSpec/DescribeClass:
107113
Enabled: false
114+
RSpec/ExampleLength:
115+
Enabled: false
108116
RSpec/MessageExpectation:
109117
Enabled: false
118+
RSpec/MultipleExpectations:
119+
Enabled: false
120+
RSpec/NestedGroups:
121+
Enabled: false
110122
Style/AsciiComments:
111123
Enabled: false
112124
Style/IfUnlessModifier:
113125
Enabled: false
114126
Style/SymbolProc:
115127
Enabled: false
116-
Style/HashSyntax:
117-
UseHashRocketsWithSymbolValues: true
118-
Style/StringLiterals:
119-
EnforcedStyle: single_quotes
120-
SupportedStyles:
121-
- single_quotes
122-
- double_quotes
123-
Exclude:
124-
- lib/puppet/provider/docker_compose/ruby.rb
125-
GetText/DecorateString:
126-
Enabled: true
127-
Exclude:
128-
- lib/puppet/type/docker_compose.rb
129-
GetText/DecorateFunctionMessage:
130-
Enabled: true
128+
Style/SafeNavigation:
129+
Description: Does not work with all ruby versions
131130
Exclude:
132-
- lib/puppet/type/docker_network.rb
133-
- lib/puppet/type/docker_volume.rb
134-
- lib/puppet/provider/docker_compose/ruby.rb
135-
GetText/DecorateStringFormattingUsingInterpolation:
136-
Enabled: true
137-
GetText/DecorateStringFormattingUsingPercent:
138-
Enabled: true
131+
- lib/puppet/parser/functions/docker_exec_flags.rb

.rubocop_todo.yml

Whitespace-only changes.

.sync.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
.travis.yml:
3+
bundler_args: ' '
4+
branches:
5+
- release
6+
remove_includes:
7+
-
8+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
9+
rvm: 2.1.9
10+
includes:
11+
-
12+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
13+
rvm: 2.3.3
14+
15+
Gemfile:
16+
required:
17+
':development':
18+
- gem: 'facter'
19+
version: '>= 1.7.0'
20+
- gem: "rspec-retry"
21+
- gem: 'thor'
22+
- gem: 'semantic_puppet'
23+
- gem: 'beaker-rspec'
24+
from_env: BEAKER_RSPEC_VERSION
25+
- gem: "beaker"
26+
version: '~> 2.0'
27+
from_env: BEAKER_VERSION
28+
- gem: 'puppet-module-posix-system-r#{minor_version}'
29+
platforms: ruby
30+
- gem: 'rspec'
31+
version: '~> 2.0'
32+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('1.8.7') && Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('1.9')"
33+
- gem: 'rake'
34+
version: '~> 10.0'
35+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('1.8.7') && Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('1.9')"
36+
37+
Rakefile:
38+
requires:
39+
- puppet-lint/tasks/puppet-lint
40+
- puppetlabs_spec_helper/rake_tasks
41+
- metadata-json-lint/rake_task
42+
- rspec_junit_formatter
43+
- puppet_pot_generator/rake_tasks
44+
45+
.rubocop.yml:
46+
include_todos:
47+
inherit_from: '.rubocop_todo.yml'
48+
profiles:
49+
strict:
50+
configs:
51+
AllCops:
52+
TargetRubyVersion: '2.2'
53+
Exclude:
54+
- spec/defines/*
55+
- spec/classes/*
56+
- spec/*
57+
- spec/acceptance/*
58+
- rakelib/*
59+
60+
61+
.gitlab-ci.yml:
62+
delete: true
63+
64+
appveyor.yml:
65+
delete: true

.travis.yml

+44-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,50 @@
11
---
2-
language: ruby
3-
bundler_args: --without development system_tests
4-
before_install: rm Gemfile.lock || true
52
sudo: false
6-
rvm:
7-
- 2.2.5
8-
- 2.3.3
3+
dist: trusty
4+
language: ruby
5+
cache: bundler
6+
before_install:
7+
- bundle -v
8+
- rm -f Gemfile.lock
9+
- gem update --system
10+
- gem --version
11+
- bundle -v
912
script:
10-
- bundle exec rake test
11-
- bundle exec rubocop lib
12-
- bundle exec puppet-lint --no-autoloader_layout-check manifests
13+
- 'bundle exec rake $CHECK'
14+
bundler_args: --without system_tests
15+
rvm:
16+
- 2.5.1
1317
env:
14-
- PUPPET_GEM_VERSION="~> 4.0"
15-
- PUPPET_GEM_VERSION="~> 5.0"
16-
- PUPPET_GEM_VERSION="~> 6.0"
18+
global:
19+
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
1720
matrix:
1821
fast_finish: true
19-
exclude:
20-
- rvm: 2.2.5
21-
env: PUPPET_GEM_VERSION="~> 6.0"
22+
include:
23+
-
24+
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
25+
-
26+
env: CHECK=parallel_spec
27+
-
28+
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
29+
rvm: 2.4.4
30+
-
31+
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
32+
rvm: 2.4.4
33+
-
34+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
35+
rvm: 2.1.9
36+
branches:
37+
only:
38+
- master
39+
- /^v\d/
40+
notifications:
41+
email: false
42+
deploy:
43+
provider: puppetforge
44+
user: puppet
45+
password:
46+
secure: ""
47+
on:
48+
tags: true
49+
all_branches: true
50+
condition: "$DEPLOY_TO_FORGE = yes"

.yardopts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--markup markdown

0 commit comments

Comments
 (0)