From 21ed4f1746ceb800519c5e6dc8d471cdf46760d9 Mon Sep 17 00:00:00 2001 From: Dan Gibbs Date: Tue, 12 Jul 2022 08:54:02 +0100 Subject: [PATCH] Explicitly set lint checks --- .sync.yml | 39 +++++++++++++++++++++++++++++++++++++++ Gemfile | 3 +++ manifests/config.pp | 2 +- manifests/init.pp | 1 - manifests/package.pp | 2 +- pdk.yaml | 2 ++ 6 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 pdk.yaml diff --git a/.sync.yml b/.sync.yml index 89165f7..4eb319f 100644 --- a/.sync.yml +++ b/.sync.yml @@ -28,6 +28,14 @@ Gemfile: - gem: 'github_changelog_generator' version: '~> 1.15' condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" + - gem: 'puppet-lint-file_ensure-check' + require: false + - gem: 'puppet-lint-manifest_whitespace-check' + require: false + - gem: 'puppet-lint-trailing_comma-check' + require: false + - gem: 'puppet-lint-optional_default-check' + require: false ':test': - gem: 'puppet_metadata' version: '~> 1.0' @@ -37,3 +45,34 @@ spec/spec_helper.rb: - 'RSpec.configure do |c|' - ' c.facter_implementation = :rspec' - 'end' +.puppet-lint.rc: + enabled_lint_checks: + - 140chars + - 2sp_soft_tabs + - arrow_alignment + - class_inherits_from_params_class + - double_quoted_strings + - duplicate_params + - file_ensure + - file_mode + - hard_tabs + - leading_zero + - manifest_whitespace_opening_brace_after + - nested_classes_or_defines + - only_variable_string + - optional_default + - parameter_documentation + - parameter_order + - parameter_types + - quoted_booleans + - right_to_left_relationship + - slash_comments + - star_comments + # - strict_indent + - trailing_comma + - trailing_whitespace + - unquoted_file_mode + - variable_contains_dash + - variable_is_lowercase + - variable_scope + - variables_not_enclosed diff --git a/Gemfile b/Gemfile index d93fe10..cd97158 100644 --- a/Gemfile +++ b/Gemfile @@ -25,6 +25,9 @@ group :development do gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "github_changelog_generator", '~> 1.15', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0') + gem "puppet-lint-file_ensure-check", require: false + gem "puppet-lint-manifest_whitespace-check", require: false + gem "puppet-lint-trailing_comma-check", require: false end group :system_tests do gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] diff --git a/manifests/config.pp b/manifests/config.pp index dab29b0..06e338e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -6,7 +6,7 @@ assert_private() file { $osquery::config_path: - ensure => present, + ensure => file, owner => $osquery::config_owner, group => $osquery::config_group, mode => '0640', diff --git a/manifests/init.pp b/manifests/init.pp index 7c04a6c..c128946 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -56,7 +56,6 @@ Optional[String] $repo_key_server = undef, Hash $settings = {}, ) { - contain osquery::package contain osquery::config contain osquery::service diff --git a/manifests/package.pp b/manifests/package.pp index 8e38145..3377be5 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -15,7 +15,7 @@ key => { id => $osquery::repo_key_id, server => $osquery::repo_key_server, - } + }, } Package<|title == $osquery::package_name|> { diff --git a/pdk.yaml b/pdk.yaml new file mode 100644 index 0000000..4bef4bd --- /dev/null +++ b/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: []