Skip to content

Commit

Permalink
Drop Puppet future parser support
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Sep 28, 2023
1 parent b11d5d4 commit da76056
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
9 changes: 2 additions & 7 deletions lib/kafo_module_lint/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def initialize(path)
end

def pass?
skip? || errors.empty?
errors.empty?
end

def errors
@errors ||= begin
errors = []
parsed[:types].each do |param,type|
check_param(param, type, errors)
end unless skip?
end
errors
end
end
Expand Down Expand Up @@ -48,10 +48,5 @@ def check_param(param, type, errors)
false
end
end

def skip?
# kafo_parsers doesn't support 3.x future parser
ENV['FUTURE_PARSER'] == 'yes'
end
end
end
10 changes: 0 additions & 10 deletions test/kafo_module_lint/linter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ module KafoModuleLint
specify { linter.pass?.must_equal true }
end

describe "with future parser" do
let(:manifest) { ManifestFactory.build({'a' => 'String', 'b' => 'Unknown[String]'}) }
before { ENV['FUTURE_PARSER'] = 'yes' }
after { ENV.delete('FUTURE_PARSER') }

specify { linter.pass?.must_equal true }
specify { linter.errors.must_equal [] }
specify { proc { linter.puts_errors }.must_output nil }
end

describe "with wrong argument count" do
let(:manifest) { ManifestFactory.build({'a' => 'String', 'b' => 'Undef["foo"]'}) }
let(:error) { /#{Regexp.escape(manifest_file)} parameter b: wrong number of arguments \(.*1.*0.*\)/ }
Expand Down

0 comments on commit da76056

Please sign in to comment.