Skip to content

Commit ac94438

Browse files
authored
Merge pull request #242 from puppetlabs/CAT-2281-Remove_puppet_7_test_infrastructure
(CAT-2281) Remove puppet 7 infrastructure
2 parents 25825df + 3126455 commit ac94438

35 files changed

+50
-54
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
ruby_version:
22-
- '2.7'
2322
- '3.2'
2423
- '3.3'
2524
name: "spec (ruby ${{ matrix.ruby_version }})"
@@ -34,7 +33,6 @@ jobs:
3433
fail-fast: false
3534
matrix:
3635
ruby_version:
37-
- '2.7'
3836
- '3.2'
3937
- '3.3'
4038
name: "acceptance (ruby ${{ matrix.ruby_version }})"

.github/workflows/nightly.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
ruby_version:
15-
- '2.7'
1615
- '3.2'
1716
- '3.3'
1817
name: "spec (ruby ${{ matrix.ruby_version }})"
@@ -26,7 +25,6 @@ jobs:
2625
fail-fast: false
2726
matrix:
2827
ruby_version:
29-
- '2.7'
3028
- '3.2'
3129
- '3.3'
3230
name: "acceptance (ruby ${{ matrix.ruby_version }})"

lib/puppet-lint.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ def print_problems
250250
# def check
251251
# end
252252
# end
253-
def self.new_check(name, &block)
253+
def self.new_check(name, &)
254254
class_name = name.to_s.split('_').map(&:capitalize).join
255255
klass = PuppetLint.const_set(:"Check#{class_name}", Class.new(PuppetLint::CheckPlugin))
256256
klass.const_set(:NAME, name)
257-
klass.class_exec(&block)
257+
klass.class_exec(&)
258258
PuppetLint.configuration.add_check(name, klass)
259259
PuppetLint::Data.ignore_overrides[name] ||= {}
260260
end

lib/puppet-lint/checkplugin.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ def manifest_lines
180180
def default_info
181181
@default_info ||= {
182182
check: self.class.const_get(:NAME),
183-
fullpath: fullpath,
184-
path: path,
185-
filename: filename
183+
fullpath:,
184+
path:,
185+
filename:
186186
}
187187
end
188188

lib/puppet-lint/checks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def load_data(path, content)
3636
problems << {
3737
kind: :error,
3838
check: :syntax,
39-
message: message,
39+
message:,
4040
line: e.line_no,
4141
column: e.column,
4242
fullpath: PuppetLint::Data.fullpath,

lib/puppet-lint/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def self.add_check(check)
4848
# Signature
4949
#
5050
# <option>=(value)
51-
def method_missing(method, *args, &_block)
51+
def method_missing(method, *args, &)
5252
super unless method.to_s =~ %r{^(\w+)=?$}
5353

5454
option = Regexp.last_match(1)

lib/puppet-lint/data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def definition_indexes(type)
359359
end: i + j + 1,
360360
tokens: tokens[i..(i + j + 1)],
361361
param_tokens: param_tokens(tokens[i..(i + j + 1)]),
362-
type: type,
362+
type:,
363363
name_token: token.next_code_token,
364364
inherited_token: inherited_class
365365
}

lib/puppet-lint/lexer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def heredoc_queue
111111
# \p{Zs} == ASCII + Unicode non-linebreaking whitespace
112112
WHITESPACE_RE = (RUBY_VERSION == '1.8.7') ? %r{[\t\v\f ]} : %r{[\t\v\f\p{Zs}]}
113113

114-
LINE_END_RE = %r{(?:\r\n|\r|\n)}.freeze
114+
LINE_END_RE = %r{(?:\r\n|\r|\n)}
115115

116-
NAME_RE = %r{\A((?:(?:::)?[_a-z0-9][-\w]*)(?:::[a-z0-9][-\w]*)*)}.freeze
116+
NAME_RE = %r{\A((?:(?:::)?[_a-z0-9][-\w]*)(?:::[a-z0-9][-\w]*)*)}
117117

118118
# Internal: An Array of Arrays containing tokens that can be described by
119119
# a single regular expression. Each sub-Array contains 2 elements, the

lib/puppet-lint/lexer/string_slurper.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ class PuppetLint::Lexer
66
class StringSlurper
77
attr_accessor :scanner, :results, :interp_stack
88

9-
START_INTERP_PATTERN = %r{\$\{}.freeze
10-
END_INTERP_PATTERN = %r{\}}.freeze
11-
END_STRING_PATTERN = %r{(\A|[^\\])(\\\\)*"}.freeze
12-
UNENC_VAR_PATTERN = %r{(\A|[^\\])\$(::)?(\w+(-\w+)*::)*\w+(-\w+)*}.freeze
13-
ESC_DQUOTE_PATTERN = %r{\\+"}.freeze
14-
LBRACE_PATTERN = %r{\{}.freeze
9+
START_INTERP_PATTERN = %r{\$\{}
10+
END_INTERP_PATTERN = %r{\}}
11+
END_STRING_PATTERN = %r{(\A|[^\\])(\\\\)*"}
12+
UNENC_VAR_PATTERN = %r{(\A|[^\\])\$(::)?(\w+(-\w+)*::)*\w+(-\w+)*}
13+
ESC_DQUOTE_PATTERN = %r{\\+"}
14+
LBRACE_PATTERN = %r{\{}
1515

1616
def initialize(string)
1717
@scanner = StringScanner.new(string)

lib/puppet-lint/monkeypatches.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class String
66
Percent = instance_method(:%) unless defined?(Percent)
77

8-
def %(*a, &b)
8+
def %(*a, &)
99
a.flatten!
1010

1111
string = case a.last
@@ -18,7 +18,7 @@ def %(*a, &b)
1818
if a.empty?
1919
string
2020
else
21-
Percent.bind_call(string, a, &b)
21+
Percent.bind_call(string, a, &)
2222
end
2323
end
2424

lib/puppet-lint/plugins.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def gem_directories
7575
end
7676
end
7777

78-
Dir[File.expand_path('plugins/**/*.rb', File.dirname(__FILE__))].sort.each do |file|
78+
Dir[File.expand_path('plugins/**/*.rb', File.dirname(__FILE__))].each do |file|
7979
require file
8080
end
8181

lib/puppet-lint/plugins/check_classes/arrow_on_right_operand_line.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def check
1212
message: "arrow should be on the right operand's line",
1313
line: token.line,
1414
column: token.column,
15-
token: token,
15+
token:,
1616
description: 'Test the manifest tokens for chaining arrow that is on the line of the left operand when the right operand is on another line.',
1717
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#chaining-arrow-syntax',
1818
)

lib/puppet-lint/plugins/check_comments/slash_comments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def check
1212
message: '// comment found',
1313
line: token.line,
1414
column: token.column,
15-
token: token,
15+
token:,
1616
description: 'Check the manifest tokens for any comments started with slashes (//) and record a warning for each instance found.',
1717
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#comments',
1818
)

lib/puppet-lint/plugins/check_comments/star_comments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def check
1212
message: '/* */ comment found',
1313
line: token.line,
1414
column: token.column,
15-
token: token,
15+
token:,
1616
description: 'Check the manifest tokens for any comments encapsulated with slash-asterisks (/* */) and record a warning for each instance found.',
1717
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#comments',
1818
)

lib/puppet-lint/plugins/check_nodes/unquoted_node_name.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def check
3131
message: 'unquoted node name found',
3232
line: token.line,
3333
column: token.column,
34-
token: token,
34+
token:,
3535
description: 'Check the manifest for unquoted node names and record a warning for each instance found.',
3636
help_uri: nil,
3737
)

lib/puppet-lint/plugins/check_resources/ensure_first_param.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def check
2020
message: "ensure found on line but it's not the first attribute",
2121
line: ensure_token.line,
2222
column: ensure_token.column,
23-
resource: resource,
23+
resource:,
2424
description: 'Check the tokens of each resource instance for an ensure parameter and if ' \
2525
'found, check that it is the first parameter listed. If it is not the first parameter, record a warning.',
2626
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#attribute-ordering',

lib/puppet-lint/plugins/check_resources/ensure_not_symlink_target.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def check
2020
line: value_token.line,
2121
column: value_token.column,
2222
param_token: ensure_token,
23-
value_token: value_token,
23+
value_token:,
2424
description: 'Check the tokens of each File resource instance for an ensure parameter and ' \
2525
'record a warning if the value of that parameter looks like a symlink target (starts with a \'/\').',
2626
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#symbolic-links',

lib/puppet-lint/plugins/check_resources/file_mode.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
MSG = 'mode should be represented as a 4 digit octal value or symbolic mode'.freeze
77
SYM_RE = '([ugoa]*[-=+][-=+rstwxXugo]*)(,[ugoa]*[-=+][-=+rstwxXugo]*)*'.freeze
88
IGNORE_TYPES = Set[:VARIABLE, :UNDEF, :FUNCTION_NAME]
9-
MODE_RE = %r{\A([0-7]{4}|#{SYM_RE})\Z}.freeze
9+
MODE_RE = %r{\A([0-7]{4}|#{SYM_RE})\Z}
1010

1111
PuppetLint.new_check(:file_mode) do
1212
def check

lib/puppet-lint/plugins/check_resources/unquoted_resource_title.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def check
1212
message: 'unquoted resource title',
1313
line: token.line,
1414
column: token.column,
15-
token: token,
15+
token:,
1616
description: 'Check the manifest tokens for any resource titles / namevars that are not quoted and record a warning for each instance found.',
1717
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#resource-names',
1818
)

lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# each instance found.
44
#
55
# https://puppet.com/docs/puppet/latest/style_guide.html#quoting
6-
ESCAPE_CHAR_RE = %r{(\\\$|\\"|\\'|'|\r|\t|\\t|\\s|\n|\\n|\\\\)}.freeze
6+
ESCAPE_CHAR_RE = %r{(\\\$|\\"|\\'|'|\r|\t|\\t|\\s|\n|\\n|\\\\)}
77

88
PuppetLint.new_check(:double_quoted_strings) do
99
def check
@@ -18,7 +18,7 @@ def check
1818
message: 'double quoted string containing no variables',
1919
line: token.line,
2020
column: token.column,
21-
token: token,
21+
token:,
2222
description: 'Check the manifest tokens for any double quoted strings that don\'t ' \
2323
'contain any variables or common escape characters and record a warning for each instance found.',
2424
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#quoting',

lib/puppet-lint/plugins/check_strings/only_variable_string.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def check
2727
message: 'string containing only a variable',
2828
line: var_token.line,
2929
column: var_token.column,
30-
start_token: start_token,
31-
var_token: var_token,
30+
start_token:,
31+
var_token:,
3232
end_token: eos_token,
3333
description: 'Check the manifest tokens for double quoted strings that contain a single variable only and record a warning for each instance found.',
3434
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#quoting',

lib/puppet-lint/plugins/check_strings/puppet_url_without_modules.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def check
1919
message: 'puppet:// URL without modules/ found',
2020
line: token.line,
2121
column: token.column,
22-
token: token,
22+
token:,
2323
description: 'Check the manifest tokens for any puppet:// URL strings where the path section doesn\'t start with modules/ and record a warning for each instance found.',
2424
help_uri: nil,
2525
)

lib/puppet-lint/plugins/check_strings/quoted_booleans.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def check
1818
message: 'quoted boolean value found',
1919
line: token.line,
2020
column: token.column,
21-
token: token,
21+
token:,
2222
description: 'Check the manifest tokens for any double or single quoted strings containing only a boolean value and record a warning for each instance found.',
2323
help_uri: nil,
2424
)

lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def check
2525
message: 'variable not enclosed in {}',
2626
line: token.line,
2727
column: token.column,
28-
token: token,
28+
token:,
2929
description: 'Check the manifest tokens for any variables in a string that have not been enclosed by braces ({}) and record a warning for each instance found.',
3030
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#quoting',
3131
)

lib/puppet-lint/plugins/check_whitespace/hard_tabs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def check
1616
message: 'tab character found',
1717
line: token.line,
1818
column: token.column,
19-
token: token,
19+
token:,
2020
description: 'Check the raw manifest string for lines containing hard tab characters and record an error for each instance found.',
2121
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#spacing-indentation-and-whitespace',
2222
)

lib/puppet-lint/plugins/check_whitespace/space_before_arrow.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def check
5151
notify(
5252
:warning,
5353
message: "there should be a single space before '=>' on line #{line}, column #{column}",
54-
line: line,
55-
column: column,
54+
line:,
55+
column:,
5656
token: prev_token,
5757
)
5858
end

lib/puppet-lint/plugins/check_whitespace/trailing_whitespace.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def check
1818
message: 'trailing whitespace found',
1919
line: token.line,
2020
column: token.column,
21-
token: token,
21+
token:,
2222
description: 'Check the manifest tokens for lines ending with whitespace and record an error for each instance found.',
2323
help_uri: 'https://puppet.com/docs/puppet/latest/style_guide.html#spacing-indentation-and-whitespace',
2424
)

lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def check_puppet
184184
message: "legacy fact '#{fact_name}'",
185185
line: token.line,
186186
column: token.column,
187-
token: token,
188-
fact_name: fact_name
187+
token:,
188+
fact_name:
189189
}
190190
end
191191
end

lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def check
3838
message: 'top scope fact instead of facts hash',
3939
line: token.line,
4040
column: token.column,
41-
token: token
41+
token:
4242
}
4343
end
4444
end

lib/puppet-lint/report/codeclimate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def self.write_report_file(problems, report_file)
2525
check_name: message[:check],
2626
description: message[:message],
2727
categories: [:Style],
28-
severity: severity,
28+
severity:,
2929
location: {
3030
path: message[:path],
3131
lines: {

lib/puppet-lint/tasks/puppet-lint.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class PuppetLint::RakeTask < Rake::TaskLib
2727
#
2828
# PuppetLint::RakeTask.new
2929
# rubocop:disable Lint/MissingSuper
30-
def initialize(*args, &task_block)
30+
def initialize(*args, &)
3131
@name = args.shift || :lint
3232
@pattern = DEFAULT_PATTERN
3333
@with_filename = true
3434
@disable_checks = []
3535
@only_checks = []
3636
@ignore_paths = []
3737

38-
define(args, &task_block)
38+
define(args, &)
3939
end
4040

4141
def define(args, &task_block)

lib/puppet-lint/tasks/release_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def run_cmd(message, *cmd)
2727
[output.strip, status.success?]
2828
end
2929

30-
def with_puppet_lint_head(&block)
30+
def with_puppet_lint_head(&)
3131
print(' Updating Gemfile to use puppet-lint HEAD... ')
3232

3333
buffer = Parser::Source::Buffer.new('Gemfile')
@@ -49,7 +49,7 @@ def with_puppet_lint_head(&block)
4949

5050
puts 'Done'
5151

52-
Bundler.with_clean_env(&block)
52+
Bundler.with_clean_env(&)
5353

5454
run_cmd('Restoring Gemfile', 'git', 'checkout', '--', 'Gemfile')
5555
end

puppet-lint.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ Gem::Specification.new do |spec|
3232
]
3333
spec.license = 'MIT'
3434

35-
spec.required_ruby_version = Gem::Requirement.new('>= 2.7'.freeze)
35+
spec.required_ruby_version = Gem::Requirement.new('>= 3.1'.freeze)
3636
end

rubocop_baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AllCops:
66
NewCops: enable
77
ExtraDetails: true
88
DisplayStyleGuide: true
9-
TargetRubyVersion: '2.7'
9+
TargetRubyVersion: '3.1'
1010
DisplayCopNames: true
1111
SuggestExtensions: false
1212
Exclude:

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class HaveProblem
3333
def initialize(method, message)
3434
@expected_problem = {
3535
kind: method.to_s.delete_prefix('contain_').to_sym,
36-
message: message
36+
message:
3737
}
3838
@description = ["contain a #{@expected_problem[:kind]}"]
3939
end
@@ -107,7 +107,7 @@ def failure_message_when_negated
107107
end
108108
end
109109

110-
def method_missing(method, *args, &block)
110+
def method_missing(method, *args, &)
111111
return HaveProblem.new(method, args.first) if method.to_s.start_with?('contain_')
112112

113113
super

0 commit comments

Comments
 (0)