-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from dev-sec/chris-rock/lint
improve code style
- Loading branch information
Showing
6 changed files
with
183 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
AllCops: | ||
Exclude: | ||
- Gemfile | ||
- Rakefile | ||
- 'test/**/*' | ||
- 'vendor/**/*' | ||
Documentation: | ||
Enabled: false | ||
AlignParameters: | ||
Enabled: true | ||
Encoding: | ||
Enabled: false | ||
HashSyntax: | ||
Enabled: true | ||
LineLength: | ||
Enabled: false | ||
EmptyLinesAroundBlockBody: | ||
Enabled: false | ||
MethodLength: | ||
Max: 40 | ||
NumericLiterals: | ||
MinDigits: 10 | ||
Metrics/CyclomaticComplexity: | ||
Max: 10 | ||
Metrics/PerceivedComplexity: | ||
Max: 11 | ||
Metrics/AbcSize: | ||
Max: 33 | ||
Style/PercentLiteralDelimiters: | ||
PreferredDelimiters: | ||
'%': '{}' | ||
'%i': () | ||
'%q': '{}' | ||
'%Q': () | ||
'%r': '{}' | ||
'%s': () | ||
'%w': '{}' | ||
'%W': () | ||
'%x': () | ||
Style/AlignHash: | ||
Enabled: false | ||
Style/PredicateName: | ||
Enabled: false | ||
Style/ZeroLengthPredicate: | ||
Enabled: false | ||
Style/NumericPredicate: | ||
Enabled: false | ||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
Style/ConditionalAssignment: | ||
Enabled: false | ||
Style/BracesAroundHashParameters: | ||
Enabled: false | ||
Style/AndOr: | ||
Enabled: false | ||
Style/Not: | ||
Enabled: false | ||
Style/FileName: | ||
Enabled: false | ||
Style/TrailingCommaInLiteral: | ||
EnforcedStyleForMultiline: comma | ||
Style/TrailingCommaInArguments: | ||
EnforcedStyleForMultiline: comma | ||
Style/NegatedIf: | ||
Enabled: false | ||
Style/UnlessElse: | ||
Enabled: false | ||
BlockDelimiters: | ||
Enabled: false | ||
Style/SpaceAroundOperators: | ||
Enabled: false | ||
Style/IfUnlessModifier: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
language: ruby | ||
cache: bundler | ||
rvm: | ||
- 2.0 | ||
- 2.2 | ||
- 2.3.1 | ||
|
||
bundler_args: --without integration | ||
script: bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rake' | ||
gem 'rack', '1.6.4' | ||
gem 'inspec', '~> 1' | ||
gem 'rubocop', '~> 0.44.0' | ||
gem 'highline', '~> 1.6.0' | ||
|
||
group :integration do | ||
gem 'berkshelf' | ||
gem 'kitchen-inspec' | ||
gem 'test-kitchen' | ||
gem 'kitchen-vagrant' | ||
end | ||
|
||
group :tools do | ||
gem 'github_changelog_generator', '~> 1.12.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env rake | ||
|
||
require 'rake/testtask' | ||
require 'rubocop/rake_task' | ||
|
||
# Rubocop | ||
desc 'Run Rubocop lint checks' | ||
task :rubocop do | ||
RuboCop::RakeTask.new | ||
end | ||
|
||
# lint the project | ||
desc 'Run robocop linter' | ||
task lint: [:rubocop] | ||
|
||
# run tests | ||
task default: [:lint, 'test:check'] | ||
|
||
namespace :test do | ||
# run inspec check to verify that the profile is properly configured | ||
task :check do | ||
dir = File.join(File.dirname(__FILE__)) | ||
sh("bundle exec inspec check #{dir}") | ||
end | ||
end | ||
|
||
# Automatically generate a changelog for this project. Only loaded if | ||
# the necessary gem is installed. | ||
# use `rake changelog to=1.2.0` | ||
begin | ||
v = ENV['to'] | ||
require 'github_changelog_generator/task' | ||
GitHubChangelogGenerator::RakeTask.new :changelog do |config| | ||
config.future_release = v | ||
config.user = 'dev-sec' | ||
config.project = 'windows-patch-baseline' | ||
end | ||
rescue LoadError | ||
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters