Skip to content

Commit be29505

Browse files
committed
(maint) Revendor puppet-lint 2.3.5
This commit updates puppet-lint to 2.3.5 which has some fixes for CRLF handling.
1 parent 0f8af70 commit be29505

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+227
-61
lines changed

server/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ task :gem_revendor do
4141
{
4242
:directory => 'puppet-lint',
4343
:github_repo => 'https://github.com/rodjek/puppet-lint.git',
44-
:github_ref => '2.3.3',
44+
:github_ref => '2.3.5',
4545
}
4646
]
4747

server/vendor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Note - To improve the packaging size, test files etc. were stripped from the Gem
1111
Gem List
1212
--------
1313

14-
* puppet-lint (https://github.com/rodjek/puppet-lint.git ref 2.3.3)
14+
* puppet-lint (https://github.com/rodjek/puppet-lint.git ref 2.3.5)

server/vendor/puppet-lint/.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Metrics/LineLength:
6060
# Offense count: 65
6161
# Configuration parameters: CountComments.
6262
Metrics/MethodLength:
63-
Max: 94
63+
Max: 105
6464

6565
# Offense count: 18
6666
Metrics/PerceivedComplexity:

server/vendor/puppet-lint/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Change Log
22

3+
## [2.3.5](https://github.com/rodjek/puppet-lint/tree/2.3.5) (2018-03-27)
4+
[Full Changelog](https://github.com/rodjek/puppet-lint/compare/2.3.4...2.3.5)
5+
6+
**Fixed bugs:**
7+
8+
- v2.3.4 breakage - 'wrong number of arguments' when using Rake task [\#812](https://github.com/rodjek/puppet-lint/issues/812)
9+
10+
**Merged pull requests:**
11+
12+
- Make PuppetLint::OptParser.build argument optional [\#813](https://github.com/rodjek/puppet-lint/pull/813) ([rodjek](https://github.com/rodjek))
13+
14+
## [2.3.4](https://github.com/rodjek/puppet-lint/tree/2.3.4) (2018-03-26)
15+
[Full Changelog](https://github.com/rodjek/puppet-lint/compare/2.3.3...2.3.4)
16+
17+
**Implemented enhancements:**
18+
19+
- Allow ignoring default configurations files on the command line [\#787](https://github.com/rodjek/puppet-lint/issues/787)
20+
- Implement --list-checks feature, to list the names of all available checks from the cli. [\#804](https://github.com/rodjek/puppet-lint/pull/804) ([xraystyle](https://github.com/xraystyle))
21+
- Option to disable loading default configurations files [\#789](https://github.com/rodjek/puppet-lint/pull/789) ([dioni21](https://github.com/dioni21))
22+
- Allow passing ignore\_paths from cli [\#783](https://github.com/rodjek/puppet-lint/pull/783) ([keymone](https://github.com/keymone))
23+
24+
**Fixed bugs:**
25+
26+
- Bad value for range [\#801](https://github.com/rodjek/puppet-lint/issues/801)
27+
- puppet-lint doesn't handle CRLFs very well [\#778](https://github.com/rodjek/puppet-lint/issues/778)
28+
- Configuration's ignore\_paths is not respected [\#774](https://github.com/rodjek/puppet-lint/issues/774)
29+
- Error when including class and missing a colon [\#507](https://github.com/rodjek/puppet-lint/issues/507)
30+
31+
**Merged pull requests:**
32+
33+
- Handle single colon in resource name syntax error [\#809](https://github.com/rodjek/puppet-lint/pull/809) ([rodjek](https://github.com/rodjek))
34+
- \(\#778\) Don't include line ending in single line comment token values [\#782](https://github.com/rodjek/puppet-lint/pull/782) ([rodjek](https://github.com/rodjek))
35+
- Fix setting ignore\_paths in Rake task [\#777](https://github.com/rodjek/puppet-lint/pull/777) ([alzabo](https://github.com/alzabo))
36+
- Add support for passing backslash separated paths to puppet-lint [\#769](https://github.com/rodjek/puppet-lint/pull/769) ([rodjek](https://github.com/rodjek))
37+
338
## [2.3.3](https://github.com/rodjek/puppet-lint/tree/2.3.3) (2017-09-28)
439
[Full Changelog](https://github.com/rodjek/puppet-lint/compare/2.3.2...2.3.3)
540

server/vendor/puppet-lint/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Status](https://secure.travis-ci.org/rodjek/puppet-lint.png)](http://travis-ci.o
55
[![Inline docs](http://inch-ci.org/github/rodjek/puppet-lint.png?branch=master)](http://inch-ci.org/github/rodjek/puppet-lint)
66

77
Puppet Lint tests Puppet code against the recommended [Puppet language style
8-
guide](http://docs.puppet.com/puppet/latest/style_guide.html). Puppet Lint validates only code style; it does not validate syntax. To test syntax, use Puppet's `puppet parser validate` command.
8+
guide](http://puppet.com/docs/puppet/latest/style_guide.html). Puppet Lint validates only code style; it does not validate syntax. To test syntax, use Puppet's `puppet parser validate` command.
99

1010
## Compatibility warning
1111

@@ -45,6 +45,10 @@ puppet-lint --fix /modules
4545

4646
Puppet Lint options allow you to modify which checks to run. You can disable any of the checks temporarily or permanently, or you can limit testing to specific checks.
4747

48+
#### List all available checks
49+
50+
To list all available checks along with basic usage documentation, use the `--list-checks` option.
51+
4852
#### Run specific checks
4953

5054
To run only specific checks, use the `--only-checks` option, with a comma-separated list of arguments specifying which checks to make:
@@ -65,7 +69,7 @@ You can disable specific Lint checks on the command line, disable them permanent
6569

6670
#### Disable checks on the command line
6771

68-
To disable any of the checks when running the `puppet-lint` command, add a `--no-<check name>-check` flag to the command. For example, to skip the 140-character check, run:
72+
To disable any of the checks when running the `puppet-lint` command, add a `--no-<check_name>-check` flag to the command. For example, to skip the 140-character check, run:
6973

7074
```
7175
puppet-lint --no-140chars-check modules/

server/vendor/puppet-lint/Rakefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ begin
1212
GitHubChangelogGenerator::RakeTask.new(:changelog) do |config|
1313
version = PuppetLint::VERSION
1414
config.future_release = version.to_s
15-
config.exclude_labels = %w[duplicate question invalid wontfix release-pr]
15+
config.exclude_labels = %w[duplicate question invalid wontfix release-pr documentation]
16+
config.enhancement_labels = %w[feature]
1617
end
1718
rescue LoadError
1819
$stderr.puts 'Changelog generation requires Ruby 2.0 or higher'
@@ -23,6 +24,14 @@ begin
2324

2425
RuboCop::RakeTask.new(:rubocop) do |task|
2526
task.options = %w[-D -E]
27+
task.patterns = [
28+
'lib/**/*.rb',
29+
'spec/**/*.rb',
30+
'bin/*',
31+
'*.gemspec',
32+
'Gemfile',
33+
'Rakefile',
34+
]
2635
end
2736
rescue LoadError
2837
$stderr.puts 'Rubocop is not available for this version of Ruby.'

server/vendor/puppet-lint/lib/puppet-lint.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
class PuppetLint::NoCodeError < StandardError; end
1414
class PuppetLint::NoFix < StandardError; end
1515

16+
# Parser Syntax Errors
17+
class PuppetLint::SyntaxError < StandardError
18+
attr_reader :token
19+
20+
def initialize(token)
21+
@token = token
22+
end
23+
end
24+
1625
# Public: The public interface to puppet-lint.
1726
class PuppetLint
1827
# Public: Gets/Sets the String manifest code to be checked.
@@ -75,7 +84,7 @@ def file=(path)
7584
return unless File.exist?(path)
7685

7786
@path = path
78-
File.open(path, 'r:UTF-8') do |f|
87+
File.open(path, 'rb:UTF-8') do |f|
7988
@code = f.read
8089
end
8190

server/vendor/puppet-lint/lib/puppet-lint/bin.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ def initialize(args)
1919
#
2020
# Returns an Integer exit code to be passed back to the shell.
2121
def run
22-
opts = PuppetLint::OptParser.build
23-
2422
begin
23+
opts = PuppetLint::OptParser.build(@args)
2524
opts.parse!(@args)
2625
rescue OptionParser::InvalidOption => e
2726
puts "puppet-lint: #{e.message}"
@@ -34,6 +33,11 @@ def run
3433
return 0
3534
end
3635

36+
if PuppetLint.configuration.list_checks
37+
puts PuppetLint.configuration.checks
38+
return 0
39+
end
40+
3741
if @args[0].nil?
3842
puts 'puppet-lint: no file specified'
3943
puts "puppet-lint: try 'puppet-lint --help' for more information"
@@ -42,6 +46,7 @@ def run
4246

4347
begin
4448
path = @args[0]
49+
path = path.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
4550
path = if File.directory?(path)
4651
Dir.glob("#{path}/**/*.pp")
4752
else
@@ -51,9 +56,11 @@ def run
5156
PuppetLint.configuration.with_filename = true if path.length > 1
5257

5358
return_val = 0
59+
ignore_paths = PuppetLint.configuration.ignore_paths
5460

5561
puts '[' if PuppetLint.configuration.json
5662
path.each do |f|
63+
next if ignore_paths.any? { |p| File.fnmatch(p, f) }
5764
l = PuppetLint.new
5865
l.file = f
5966
l.run

server/vendor/puppet-lint/lib/puppet-lint/checks.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ def run(fileinfo, data)
6666
end
6767
end
6868

69+
@problems
70+
rescue PuppetLint::SyntaxError => e
71+
@problems << {
72+
:kind => :error,
73+
:check => :syntax,
74+
:message => 'Syntax error',
75+
:fullpath => File.expand_path(fileinfo, ENV['PWD']),
76+
:filename => File.basename(fileinfo),
77+
:path => fileinfo,
78+
:line => e.token.line,
79+
:column => e.token.column,
80+
}
81+
6982
@problems
7083
rescue => e
7184
$stdout.puts <<-END.gsub(%r{^ {6}}, '')

server/vendor/puppet-lint/lib/puppet-lint/data.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ def resource_indexes
176176
end_token = colon_token.next_token_of([:SEMIC, :RBRACE])
177177
end_idx = tokens.index(end_token)
178178

179+
raise PuppetLint::SyntaxError, colon_token if end_idx.nil?
180+
179181
result << {
180182
:start => start_idx + 1,
181183
:end => end_idx,

0 commit comments

Comments
 (0)