Skip to content

Commit

Permalink
linting and fixing ansible install, added pwsh, and a few other utili…
Browse files Browse the repository at this point in the history
…ties

Signed-off-by: Aaron Lippold <[email protected]>
  • Loading branch information
aaronlippold committed Jan 24, 2024
1 parent 9faa73c commit 0b4c364
Show file tree
Hide file tree
Showing 201 changed files with 1,150 additions and 1,614 deletions.
178 changes: 42 additions & 136 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,162 +1,68 @@
*.json
*.lock
.DS_Store
*.gem
*.rbc

.attribute.yml

/.vscode
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
inspec-azure.plan
inspec-aws-*.plan


*.tfstate
*.tfstate.*
.terraform/
terraform.tfvars

# Test Kitchenb
.kitchen/
/test/tmp/
/test/version_tmp/
/tmp/
spec/results/**
.kitchen
.kitchen.local.yml
kitchen.local.yml

# Chef
Berksfile.lock
.zero-knife.rb
Policyfile.lock.json

# Temp
.vagrant
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~

inspec-deprecations-in-cfg.txt
inspec-deprecations-in-lib.txt

# Docker
*.retry
.backup
Gemfile.lock
inspec.lock
.kitchen
vendor/**
Evaluate-STIG/**
baseline/**
# Used by dotenv library to load environment variables.
# .env

# Ignore Byebug command history file.
.byebug_history

## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

# OSX
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Logs
*.log

## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

# Ignore bundler config
## Environment normalization:
/.bundle/
/vendor/
/vendor/bundle
vendor/cookbooks

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
.packer
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.ruby-version
.ruby-gemset


## JetBrain
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea/

## Specific to RubyMotion:
.dat*
.repl_history
*.bridgesupport

# File-based project format
*.iws

# IntelliJ
out/
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# mpeltonen/sbt-idea plugin
.idea_modules/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# JIRA plugin
atlassian-ide-plugin.xml


# Build Folder
/build/
/build-iPhoneOS/
/build-iPhoneSimulator/


# Ignore rendered files from docs/
source/docs/reference/
examples/meta-profile/vendor/
habitat/VERSION
habitat/results
/lib/bundler/man/
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

# USER
/.gitignoredir/
/tmp/
/test/tmp/
/test/version_tmp/
/.emacs.desktop
.gitter
*.elc
nbproject
auto-save-list
tramp
/.direnv
/.envrc
results/
contrib/*
# VS CODE / VSCODIUM
.vscode
58 changes: 58 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
AllCops:
Exclude:
- "libraries/**/*"

Layout/LineLength:
Max: 1500
AllowURI: true
IgnoreCopDirectives: true

Naming/FileName:
Enabled: false

Metrics/BlockLength:
Max: 1000

Lint/ConstantDefinitionInBlock:
Enabled: false

# Required for Profiles as it can introduce profile errors
Style/NumericPredicate:
Enabled: false

Style/WordArray:
Description: "Use %w or %W for an array of words. (https://rubystyle.guide#percent-w)"
Enabled: false

Style/RedundantPercentQ:
Enabled: true

Style/NestedParenthesizedCalls:
Enabled: false

Style/TrailingCommaInHashLiteral:
Description: "https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral"
Enabled: true
EnforcedStyleForMultiline: no_comma

Style/TrailingCommaInArrayLiteral:
Enabled: true
EnforcedStyleForMultiline: no_comma

Style/BlockDelimiters:
Enabled: false

Lint/AmbiguousBlockAssociation:
Enabled: false

Metrics/BlockNesting:
Enabled: false

Lint/ShadowingOuterLocalVariable:
Enabled: false

Style/FormatStringToken:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem "test-kitchen"
gem 'cookstyle'
gem 'highline'
gem 'inspec', '~> 5'
gem 'inspec-bin'
gem 'inspec-core'
gem 'kitchen-ansible'
gem 'kitchen-docker'
gem 'kitchen-dokken'
gem 'kitchen-ec2'
gem 'kitchen-inspec'
gem 'kitchen-sync'
gem 'kitchen-vagrant'
gem 'pry-byebug'
gem 'rake'
gem 'rubocop'
gem 'rubocop'
gem 'rubocop-rake'
gem 'test-kitchen'
gem 'train-awsssm'
14 changes: 14 additions & 0 deletions Gemfile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
source 'https://rubygems.org'

gem "test-kitchen"
gem 'highline'
gem 'inspec', '~> 5'
gem 'inspec-bin'
gem 'kitchen-ansible'
gem 'kitchen-docker'
gem 'kitchen-ec2'
gem 'kitchen-inspec'
gem 'kitchen-sync'
gem 'kitchen-vagrant'
gem 'rake'
gem 'rubocop'
24 changes: 24 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

# !/usr/bin/env rake

require 'rake/testtask'
require 'rubocop/rake_task'

namespace :inspec do
desc 'validate the inspec profile'
task :check do
system 'bundle exec inspec check .'
end
end

begin
RuboCop::RakeTask.new(:lint) do |task|
task.options += %w[--display-cop-names --no-color --parallel]
end
rescue LoadError
puts 'rubocop is not available. Install the rubocop gem to run the lint tests.'
end

desc 'pre-commit checks'
task pre_commit_checks: [:lint, 'inspec:check']
26 changes: 0 additions & 26 deletions Review.md

This file was deleted.

Loading

0 comments on commit 0b4c364

Please sign in to comment.