puppet-lint 2.3.6 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +238 -87
- data/README.md +18 -0
- data/lib/puppet-lint.rb +1 -1
- data/lib/puppet-lint/data.rb +26 -11
- data/lib/puppet-lint/lexer.rb +97 -200
- data/lib/puppet-lint/lexer/string_slurper.rb +173 -0
- data/lib/puppet-lint/lexer/token.rb +8 -0
- data/lib/puppet-lint/optparser.rb +4 -5
- data/lib/puppet-lint/plugins/check_classes/parameter_order.rb +12 -1
- data/lib/puppet-lint/plugins/check_conditionals/case_without_default.rb +15 -1
- data/lib/puppet-lint/plugins/check_documentation/documentation.rb +4 -0
- data/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb +5 -2
- data/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +1 -0
- data/lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb +71 -0
- data/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb +1 -1
- data/lib/puppet-lint/tasks/puppet-lint.rb +14 -0
- data/lib/puppet-lint/tasks/release_test.rb +3 -1
- data/lib/puppet-lint/version.rb +1 -1
- data/spec/fixtures/test/manifests/two_warnings.pp +5 -0
- data/spec/puppet-lint/bin_spec.rb +47 -6
- data/spec/puppet-lint/data_spec.rb +12 -0
- data/spec/puppet-lint/lexer/string_slurper_spec.rb +473 -0
- data/spec/puppet-lint/lexer_spec.rb +1153 -590
- data/spec/puppet-lint/plugins/check_classes/parameter_order_spec.rb +18 -0
- data/spec/puppet-lint/plugins/check_classes/variable_scope_spec.rb +15 -1
- data/spec/puppet-lint/plugins/check_conditionals/case_without_default_spec.rb +39 -0
- data/spec/puppet-lint/plugins/check_documentation/documentation_spec.rb +18 -0
- data/spec/puppet-lint/plugins/check_resources/ensure_first_param_spec.rb +16 -0
- data/spec/puppet-lint/plugins/check_strings/double_quoted_strings_spec.rb +5 -5
- data/spec/puppet-lint/plugins/check_strings/only_variable_string_spec.rb +6 -6
- data/spec/puppet-lint/plugins/check_strings/variables_not_enclosed_spec.rb +32 -0
- data/spec/puppet-lint/plugins/check_variables/variable_is_lowercase_spec.rb +28 -0
- data/spec/spec_helper.rb +7 -5
- metadata +14 -17
- data/.gitignore +0 -12
- data/.rspec +0 -2
- data/.rubocop.yml +0 -74
- data/.rubocop_todo.yml +0 -89
- data/.travis.yml +0 -24
- data/Gemfile +0 -40
- data/Rakefile +0 -42
- data/appveyor.yml +0 -33
- data/puppet-lint.gemspec +0 -19
data/.rubocop_todo.yml
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2017-08-28 12:57:58 +1000 using RuboCop version 0.49.1.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 3
|
10
|
-
# Configuration parameters: Include.
|
11
|
-
# Include: **/Gemfile, **/gems.rb
|
12
|
-
Bundler/DuplicatedGem:
|
13
|
-
Exclude:
|
14
|
-
- 'Gemfile'
|
15
|
-
|
16
|
-
# Offense count: 2
|
17
|
-
# Cop supports --auto-correct.
|
18
|
-
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
19
|
-
# Include: **/Gemfile, **/gems.rb
|
20
|
-
Bundler/OrderedGems:
|
21
|
-
Exclude:
|
22
|
-
- 'Gemfile'
|
23
|
-
|
24
|
-
# Offense count: 9
|
25
|
-
# Configuration parameters: AllowSafeAssignment.
|
26
|
-
Lint/AssignmentInCondition:
|
27
|
-
Exclude:
|
28
|
-
- 'lib/puppet-lint/lexer.rb'
|
29
|
-
- 'lib/puppet-lint/plugins/check_classes/variable_scope.rb'
|
30
|
-
|
31
|
-
# Offense count: 52
|
32
|
-
Metrics/AbcSize:
|
33
|
-
Max: 153
|
34
|
-
|
35
|
-
# Offense count: 121
|
36
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
37
|
-
Metrics/BlockLength:
|
38
|
-
Max: 1136
|
39
|
-
|
40
|
-
# Offense count: 8
|
41
|
-
# Configuration parameters: CountBlocks.
|
42
|
-
Metrics/BlockNesting:
|
43
|
-
Max: 5
|
44
|
-
|
45
|
-
# Offense count: 2
|
46
|
-
# Configuration parameters: CountComments.
|
47
|
-
Metrics/ClassLength:
|
48
|
-
Max: 383
|
49
|
-
|
50
|
-
# Offense count: 20
|
51
|
-
Metrics/CyclomaticComplexity:
|
52
|
-
Max: 26
|
53
|
-
|
54
|
-
# Offense count: 238
|
55
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
56
|
-
# URISchemes: http, https
|
57
|
-
Metrics/LineLength:
|
58
|
-
Max: 223
|
59
|
-
|
60
|
-
# Offense count: 65
|
61
|
-
# Configuration parameters: CountComments.
|
62
|
-
Metrics/MethodLength:
|
63
|
-
Max: 105
|
64
|
-
|
65
|
-
# Offense count: 18
|
66
|
-
Metrics/PerceivedComplexity:
|
67
|
-
Max: 25
|
68
|
-
|
69
|
-
# Offense count: 1
|
70
|
-
# Cop supports --auto-correct.
|
71
|
-
Performance/RedundantBlockCall:
|
72
|
-
Exclude:
|
73
|
-
- 'lib/puppet-lint/tasks/puppet-lint.rb'
|
74
|
-
|
75
|
-
# Offense count: 7
|
76
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
77
|
-
# SupportedStyles: nested, compact
|
78
|
-
Style/ClassAndModuleChildren:
|
79
|
-
Exclude:
|
80
|
-
- 'lib/puppet-lint.rb'
|
81
|
-
- 'lib/puppet-lint/bin.rb'
|
82
|
-
- 'lib/puppet-lint/checkplugin.rb'
|
83
|
-
- 'lib/puppet-lint/checks.rb'
|
84
|
-
- 'lib/puppet-lint/data.rb'
|
85
|
-
- 'lib/puppet-lint/optparser.rb'
|
86
|
-
|
87
|
-
# Offense count: 20
|
88
|
-
Style/MultilineBlockChain:
|
89
|
-
Enabled: false
|
data/.travis.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
sudo: false
|
4
|
-
before_install: gem update --system && gem install bundler
|
5
|
-
branches:
|
6
|
-
only:
|
7
|
-
- master
|
8
|
-
bundler_args: --without development system_tests
|
9
|
-
script:
|
10
|
-
- bundle exec rake $CHECK
|
11
|
-
env:
|
12
|
-
- CHECK=ci
|
13
|
-
rvm:
|
14
|
-
- 1.8.7
|
15
|
-
- 1.9.3
|
16
|
-
- 2.0.0
|
17
|
-
- 2.1.10
|
18
|
-
- 2.2.7
|
19
|
-
- 2.3.4
|
20
|
-
- 2.4.1
|
21
|
-
matrix:
|
22
|
-
include:
|
23
|
-
- rvm: 2.4.1
|
24
|
-
env: CHECK=rubocop
|
data/Gemfile
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :test do
|
6
|
-
gem 'rake', '~> 10.0'
|
7
|
-
gem 'rspec-its', '~> 1.0'
|
8
|
-
gem 'rspec-collection_matchers', '~> 1.0'
|
9
|
-
|
10
|
-
if RUBY_VERSION < '2.0'
|
11
|
-
# json 2.x requires ruby 2.0. Lock to 1.8
|
12
|
-
gem 'json', '= 1.8'
|
13
|
-
# json_pure 2.0.2 requires ruby 2.0, and 2.0.1 requires ruby 1.9. Lock to 1.8.3.
|
14
|
-
gem 'json_pure', '= 1.8.3'
|
15
|
-
# addressable 2.4.0 requires ruby 1.9.0. Lock to 2.3.8.
|
16
|
-
gem 'addressable', '= 2.3.8'
|
17
|
-
gem 'diff-lcs', '< 1.3'
|
18
|
-
gem 'rspec', '<= 3.4'
|
19
|
-
else
|
20
|
-
gem 'rspec', '~> 3.0'
|
21
|
-
gem 'json'
|
22
|
-
end
|
23
|
-
|
24
|
-
if RUBY_VERSION > '1.8'
|
25
|
-
# requires ruby 1.9+, on 1.8 we'll fall back to the old regex parsing
|
26
|
-
gem 'rspec-json_expectations', '~> 1.4'
|
27
|
-
end
|
28
|
-
|
29
|
-
gem 'rubocop', '0.49.1' if RUBY_VERSION > '2.0'
|
30
|
-
gem 'simplecov', :require => false
|
31
|
-
end
|
32
|
-
|
33
|
-
group :development do
|
34
|
-
# For Changelog generation
|
35
|
-
if RUBY_VERSION > '1.9'
|
36
|
-
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
|
37
|
-
gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2'
|
38
|
-
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
|
39
|
-
end
|
40
|
-
end
|
data/Rakefile
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'puppet-lint'
|
4
|
-
require 'puppet-lint/tasks/release_test'
|
5
|
-
|
6
|
-
task :default => :test
|
7
|
-
|
8
|
-
RSpec::Core::RakeTask.new(:test)
|
9
|
-
|
10
|
-
begin
|
11
|
-
require 'github_changelog_generator/task'
|
12
|
-
GitHubChangelogGenerator::RakeTask.new(:changelog) do |config|
|
13
|
-
version = PuppetLint::VERSION
|
14
|
-
config.future_release = version.to_s
|
15
|
-
config.exclude_labels = %w[duplicate question invalid wontfix release-pr documentation]
|
16
|
-
config.enhancement_labels = %w[feature]
|
17
|
-
end
|
18
|
-
rescue LoadError
|
19
|
-
$stderr.puts 'Changelog generation requires Ruby 2.0 or higher'
|
20
|
-
end
|
21
|
-
|
22
|
-
begin
|
23
|
-
require 'rubocop/rake_task'
|
24
|
-
|
25
|
-
RuboCop::RakeTask.new(:rubocop) do |task|
|
26
|
-
task.options = %w[-D -E]
|
27
|
-
task.patterns = [
|
28
|
-
'lib/**/*.rb',
|
29
|
-
'spec/**/*.rb',
|
30
|
-
'bin/*',
|
31
|
-
'*.gemspec',
|
32
|
-
'Gemfile',
|
33
|
-
'Rakefile',
|
34
|
-
]
|
35
|
-
end
|
36
|
-
rescue LoadError
|
37
|
-
$stderr.puts 'Rubocop is not available for this version of Ruby.'
|
38
|
-
end
|
39
|
-
|
40
|
-
task :ci => [:test, :release_test]
|
41
|
-
|
42
|
-
# vim: syntax=ruby
|
data/appveyor.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
build: off
|
2
|
-
|
3
|
-
branches:
|
4
|
-
only:
|
5
|
-
- master
|
6
|
-
|
7
|
-
# ruby versions under test
|
8
|
-
environment:
|
9
|
-
matrix:
|
10
|
-
- RUBY_VERSION: 193
|
11
|
-
- RUBY_VERSION: 200
|
12
|
-
- RUBY_VERSION: 21
|
13
|
-
- RUBY_VERSION: 22
|
14
|
-
- RUBY_VERSION: 23-x64
|
15
|
-
- RUBY_VERSION: 24-x64
|
16
|
-
|
17
|
-
matrix:
|
18
|
-
allow_failures:
|
19
|
-
- RUBY_VERSION: 193
|
20
|
-
|
21
|
-
install:
|
22
|
-
- SET PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
23
|
-
- SET LOG_SPEC_ORDER=true
|
24
|
-
- bundle install --jobs 4 --retry 2 --without development
|
25
|
-
|
26
|
-
before_test:
|
27
|
-
- type Gemfile.lock
|
28
|
-
- ruby -v
|
29
|
-
- gem -v
|
30
|
-
- bundle -v
|
31
|
-
|
32
|
-
test_script:
|
33
|
-
- bundle exec rake ci
|
data/puppet-lint.gemspec
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
$LOAD_PATH.push(File.expand_path('../lib', __FILE__))
|
2
|
-
require 'puppet-lint/version'
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = 'puppet-lint'
|
6
|
-
s.version = PuppetLint::VERSION.dup
|
7
|
-
s.homepage = 'https://github.com/rodjek/puppet-lint/'
|
8
|
-
s.summary = 'Ensure your Puppet manifests conform with the Puppetlabs style guide'
|
9
|
-
s.description = 'Checks your Puppet manifests against the Puppetlabs
|
10
|
-
style guide and alerts you to any discrepancies.'
|
11
|
-
|
12
|
-
s.files = `git ls-files`.split("\n")
|
13
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
15
|
-
s.require_paths = ['lib']
|
16
|
-
|
17
|
-
s.authors = ['Tim Sharpe']
|
18
|
-
s.email = 'tim@sharpe.id.au'
|
19
|
-
end
|