Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Convert to PDK (#44)
Browse files Browse the repository at this point in the history
* Update repo with PDK
* Rebuild Changelog from PR tags
* lint README
* Remove Gemfile.lock
* Remove tests/init.pp
* Update spec tests to conform to Rubocop
  • Loading branch information
coreone committed Jan 2, 2020
1 parent f82080b commit 67cb119
Show file tree
Hide file tree
Showing 21 changed files with 1,623 additions and 1,065 deletions.
42 changes: 42 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,42 @@
---
version: 2.1

orbs:
puppet: 'broadinstitute/bits-puppet@0.1.0'

workflows:
static_analysis:
jobs:
- puppet/static
test_and_deploy:
jobs:
- puppet/run-tests:
name: 'puppet-5-ruby-2.3.8'
ruby_version: '2.3.8'
puppet_version: '< 6.0.0'
- puppet/run-tests:
name: 'puppet-5-ruby-2.4.6'
ruby_version: '2.4.6'
puppet_version: '< 6.0.0'
- puppet/run-tests:
name: 'puppet-5-ruby-2.5.5'
ruby_version: '2.5.5'
puppet_version: '< 6.0.0'
- puppet/run-tests:
name: 'puppet-6-ruby-2.3.8'
ruby_version: '2.3.8'
puppet_version: '< 7.0.0'
- puppet/run-tests:
name: 'puppet-6-ruby-2.4.6'
ruby_version: '2.4.6'
puppet_version: '< 7.0.0'
- puppet/run-tests:
name: 'puppet-6-ruby-2.5.5'
ruby_version: '2.5.5'
puppet_version: '< 7.0.0'
- puppet/deploy:
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
5 changes: 5 additions & 0 deletions .gitattributes
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
40 changes: 29 additions & 11 deletions .gitignore
@@ -1,12 +1,30 @@
.*.sw?
pkg
spec/fixtures
.rspec_system
.vagrant
.bundle
vendor
.idea
.project
.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
.librarian/*
.tmp/*
.project
.envrc
/inventory.yaml
/.librarian
/.tmp
/spec/fixtures/work-dir
42 changes: 42 additions & 0 deletions .pdkignore
@@ -0,0 +1,42 @@
.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/
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -3,24 +3,24 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/chriskuehl/puppet-pre-commit-hooks.git
rev: v2.1.0
hooks:
- id: puppet-validate
- id: erb-validate
- id: epp-validate
- id: erb-validate
- id: puppet-lint
args:
- --fail-on-warnings
- --relative
- id: puppet-validate
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.20.0
hooks:
Expand Down
4 changes: 4 additions & 0 deletions .puppet-lint.rc
@@ -0,0 +1,4 @@
--relative
--no-80chars-check
--no-autoloader_layout-check
--no-puppet_url_without_modules-check
1 change: 1 addition & 0 deletions .rspec
@@ -1 +1,2 @@
--color
--format documentation
133 changes: 133 additions & 0 deletions .rubocop.yml
@@ -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
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
32 changes: 32 additions & 0 deletions .sync.yml
@@ -0,0 +1,32 @@
---
appveyor.yml:
delete: true
.gitignore:
required:
- '/.librarian'
- '/.tmp'
- '/spec/fixtures/work-dir'
.gitlab-ci.yml:
delete: true
Rakefile:
changelog_project: 'puppet-certs'
changelog_user: 'broadinstitute'
changelog_version_tag_pattern: '%s'
extra_disabled_lint_checks:
- '80chars'
- 'autoloader_layout'
- 'puppet_url_without_modules'
requires:
- 'puppet-lint/tasks/puppet-lint'
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
.travis.yml:
delete: true
.yardopts:
delete: true
spec/default_facts.yml:
delete: true
spec/spec_helper.rb:
hiera_config: 'spec/fixtures/hiera.yaml'
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .vscode/extensions.json
@@ -0,0 +1,6 @@
{
"recommendations": [
"jpogran.puppet-vscode",
"rebornix.Ruby"
]
}

0 comments on commit 67cb119

Please sign in to comment.