Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,34 +164,48 @@ jobs:
RUBY_VERSION: '2.4.3'
PUPPET_VERSION: '6.5.0'

specs-ruby26-puppet46:
specs-ruby25-puppet46:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.6.3'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '4.6.2'

specs-ruby26-puppet410:
specs-ruby25-puppet410:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.6.3'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '4.10.9'

specs-ruby26-puppet50:
specs-ruby25-puppet50:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.6.3'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '5.0.1'

specs-ruby26-puppet53:
specs-ruby25-puppet53:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.6.3'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '5.3.3'

specs-ruby25-puppet60:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '6.0.0'

specs-ruby25-puppet65:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '6.5.0'

specs-ruby26-puppet60:
<<: *specs
environment:
Expand Down Expand Up @@ -233,7 +247,7 @@ jobs:
machine: true
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.6.3'
RUBY_VERSION: '2.5.3'
steps:
- checkout
- run:
Expand Down Expand Up @@ -273,11 +287,13 @@ workflows:
- specs-ruby24-puppet53
- specs-ruby24-puppet60
- specs-ruby24-puppet65
- specs-ruby26-puppet46
- specs-ruby26-puppet410
- specs-ruby26-puppet50
- specs-ruby26-puppet53
- specs-ruby25-puppet46
- specs-ruby25-puppet410
- specs-ruby25-puppet50
- specs-ruby25-puppet53
- specs-ruby25-puppet60
- specs-ruby25-puppet65
- specs-ruby25-puppet65-windows
- specs-ruby26-puppet60
- specs-ruby26-puppet65
- specs-ruby25-puppet65-windows
- verify-gemfile-lock-dependencies
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
27 changes: 23 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
pkg/*
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/junit/
/log/
/pkg/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
spec/fixtures
.rspec_system
.bundle
vendor

.rbenv-gemsets
.ruby-version

tests/centos/.vagrant
tests/ubuntu/.vagrant

# mac stuff
.DS_Store
.project
.envrc
/inventory.yaml
43 changes: 43 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
/tests/
3 changes: 3 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--relative
--no-140chars-check
--fail-on-warnings
133 changes: 133 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Include:
- "./**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
- "**/Gemfile"
- "**/Rakefile"
- pkg/**/*
- spec/fixtures/**/*
- vendor/**/*
- "**/Puppetfile"
- "**/Vagrantfile"
- "**/Guardfile"
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Exclude:
- spec/acceptance/**/*.rb
RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each
Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
EnforcedStyle: braces_for_chaining
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Style/EmptyElse:
Description: Enforce against empty else clauses, but allow `nil` for clarity.
EnforcedStyle: empty
Style/FormatString:
Description: Following the main puppet project's style, prefer the % format format.
EnforcedStyle: percent
Style/FormatStringToken:
Description: Following the main puppet project's style, prefer the simpler template
tokens over annotated ones.
EnforcedStyle: template
Style/Lambda:
Description: Prefer the keyword for easier discoverability.
EnforcedStyle: literal
Style/RegexpLiteral:
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
EnforcedStyle: percent_r
Style/TernaryParentheses:
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
on complex expressions for better readability, but seriously consider breaking
it up.
EnforcedStyle: require_parentheses_when_complex
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
RSpec/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
- spec/**/*
Style/WordArray:
EnforcedStyle: brackets
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've disabled a bunch of stuff here? Are all these necessary? Definitely fine if it is, just wondering.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PDK adds this file as-is by default. We aren't using it yet, though.

GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Style/SymbolProc:
Enabled: false
51 changes: 28 additions & 23 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
source "https://rubygems.org"

group :test do
gem "rb-inotify", '< 0.10.0' if RUBY_VERSION < '2.2.0'
gem "public_suffix", "~> 3.0.0"
gem "listen", "~> 3.0.0"
# Puppet 4.10.2 is the minimum version we support on Windows due to https://tickets.puppetlabs.com/browse/PUP-7383
# On Linux we support down to 4.6
gem "puppet", "~> #{ENV.fetch('PUPPET_VERSION', '4.10.2')}"
gem "puppet-lint", "~> 2.3.6"
gem "puppet-syntax", "~> 2.5.0"
gem "puppetlabs_spec_helper", "~> 2.14.1"
gem "jwt", "~> 1.5.6"
gem "rake", "~> 12.3.3" # last version to support ruby < 2.6
gem "rspec-puppet", '2.6.9'
gem "ruby-pwsh", '~> 0.3.0', platforms: [:mswin, :mingw, :x64_mingw]
end
# Puppet 4.10.2 is the minimum version we support on Windows due to https://tickets.puppetlabs.com/browse/PUP-7383
# On Linux we support down to 4.6
gem "puppet", "~> #{ENV.fetch('PUPPET_VERSION', '4.10.2')}"

ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fog-openstack", "0.1.25" if RUBY_VERSION < '2.2.0'
gem "guard-rake"
gem "mocha", "~> 1.9.0"
gem "rspec-core", "~> 3.8.2"
gem "rspec-expectations", "~> 3.8.4"
gem "rspec-mocks", "~> 3.8.1"
gem "puppet-blacksmith", "~> 4.1.2"
gem "xmlrpc" if RUBY_VERSION >= '2.3'
gem "rake", "~> 12.3.3" if RUBY_VERSION < '2.6.0' # last version for ruby < 2.6
gem "xmlrpc" if RUBY_VERSION >= '2.3'
gem "ruby-pwsh", '~> 0.3.0', platforms: [:mswin, :mingw, :x64_mingw]
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
if RUBY_VERSION >= '2.3'
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
else
gem "puppetlabs_spec_helper", "~> 2.14.1"
gem "puppet-lint", "~> 2.4.2"
gem "metadata-json-lint", "~> 1.2.2"
gem "puppet-syntax", "~> 2.5.0"
gem "rspec-puppet", '2.6.9'
end
end
Loading