Skip to content

Commit

Permalink
Cookstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGibbons committed Feb 28, 2020
1 parent 0b961ea commit 91b2b0c
Show file tree
Hide file tree
Showing 50 changed files with 87 additions and 90 deletions.
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cookbook Name:: chefdk_bootstrap
# Cookbook:: chefdk_bootstrap
# Rakefile

# Copyright 2016 Nordstrom, Inc.
# Copyright:: 2016 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@ RSpec::Core::RakeTask.new(:spec) do |t|
end

desc 'Run Rubocop and Foodcritic style checks'
task style: %i[rubocop foodcritic]
task style: %i(rubocop foodcritic)

desc 'Run all style checks and unit tests'
task test: %i[style spec]
task test: %i(style spec)

task default: :test

Expand Down
17 changes: 9 additions & 8 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015, 2018 Nordstrom, Inc.
# Copyright:: 2015, 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@
install['chefdk_julia'] = false
install['kitchen_proxy'] = true
install['gitconfig'] = false
# TODO VSCODE
# TODO: VSCODE
end

# No virtual box on vm
Expand All @@ -44,14 +44,14 @@
install['poshgit'] = true
install['conemu'] = true
end
default['atom']['packages'] = %w[]
default['atom']['packages'] = %w()
when 'mac_os_x'
default['chefdk_bootstrap']['package'].tap do |install|
install['iterm2'] = true
install['bash_profile'] = true
end
# Default Atom plugins
default['atom']['packages'] = %w[language-powershell linter linter-cookstyle linter-erb linter-foodcritic linter-rubocop merge-conflicts rubocop-auto-correct]
default['atom']['packages'] = %w(language-powershell linter linter-cookstyle linter-erb linter-foodcritic linter-rubocop merge-conflicts rubocop-auto-correct)
end

default['chefdk_bootstrap']['gitconfig'] = {
Expand All @@ -62,7 +62,7 @@
'alias.ci' => { value: 'commit' },
'alias.st' => { value: 'status' },
'alias.lol' => { value: "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" },
'push.default' => { value: 'simple' }
'push.default' => { value: 'simple' },
}

default['chefdk_bootstrap']['gitconfig']['credential.helper'] = { value: 'osxkeychain' } if platform_family?('mac_os_x')
Expand All @@ -78,6 +78,7 @@
# Skip the proxy for these domains and IPs. This should be a comma-separated string
default['chefdk_bootstrap']['proxy']['no_proxy'] = ENV['no_proxy'] # 'example.com,localhost,127.0.0.1'

# TODO update virtual box
default['chefdk_bootstrap']['virtualbox']['source'] = 'https://download.virtualbox.org/virtualbox/6.1.2/VirtualBox-6.1.2-135662-OSX.dmg'
default['chefdk_bootstrap']['virtualbox']['checksum'] = '20fb52bbd7edec58c9eef69046240a809091727872b8b4b254db272ffd6950b4'
default['vagrant']['plugins'] = [{ name: 'vagrant-vbguest' }]

default['chefdk_bootstrap']['virtualbox']['source'] = 'https://download.virtualbox.org/virtualbox/6.1.4/VirtualBox-6.1.4-136177-OSX.dmg'
default['chefdk_bootstrap']['virtualbox']['checksum'] = '2bc5d7282d9af9ce12dffddb528dcf6c9eb7ea92e644885d805e1e56fd55bacf'
6 changes: 3 additions & 3 deletions bootstrap.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env ruby
#
# Copyright 2016, 2018 Nordstrom, Inc.
# Copyright:: 2016, 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -135,8 +135,8 @@ def delete

# Install chef workstation
class ChefDK
CHEFDK_VERSION_PATTERN = /Chef Workstation Version: (?<version>\d{1,2}\.\d{1,2}\.\d{1,2})/i
CHEFDK_LATEST_PATTERN = /version\s(?<version>\d{1,2}\.\d{1,2}\.\d{1,2})/i
CHEFDK_VERSION_PATTERN = /Chef Workstation Version: (?<version>\d{1,2}\.\d{1,2}\.\d{1,2})/i.freeze
CHEFDK_LATEST_PATTERN = /version\s(?<version>\d{1,2}\.\d{1,2}\.\d{1,2})/i.freeze

def initialize(options)
@target_version = options[:version]
Expand Down
4 changes: 2 additions & 2 deletions libraries/os.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
# Cookbook Name:: atom
# Cookbook:: atom
# Library:: os
#
# Author:: Mark Gibbons
#
# Copyright 2018 Nordstrom, Inc.
# Copyright:: 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015, 2018 Nordstrom, Inc.
# Copyright:: 2015, 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/atom.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions recipes/atom_debian.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: chef-atom
# Cookbook:: chef-atom
# Recipe:: debian
#
# Copyright (c) 2016 Doug Ireton
# Copyright:: (c) 2016 Doug Ireton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,6 @@

apt_repository 'atom-ppa' do
uri 'http://ppa.launchpad.net/webupd8team/atom/ubuntu'
distribution node['lsb']['codename']
components ['main']
keyserver 'keyserver.ubuntu.com'
key 'EEA14886'
Expand Down
4 changes: 2 additions & 2 deletions recipes/atom_default.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: chef-atom
# Cookbook:: chef-atom
# Recipe:: default
#
# Copyright (c) 2016 Doug Ireton
# Copyright:: (c) 2016 Doug Ireton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions recipes/atom_mac_os_x.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: chef-atom
# Cookbook:: chef-atom
# Recipe:: mac_os_x
#
# Copyright (c) 2016 Doug Ireton
# Copyright:: (c) 2016 Doug Ireton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/atom_plugins.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Nordstrom, Inc.
# Copyright:: 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions recipes/atom_windows.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: chef-atom
# Cookbook:: chef-atom
# Recipe:: windows
#
# Copyright (c) 2016 Doug Ireton
# Copyright:: (c) 2016 Doug Ireton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/bash_profile.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016 Nordstrom, Inc.
# Copyright:: 2016 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/chef_ca.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Nordstrom, Inc.
# Copyright:: 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/chefdk_julia.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if node['chefdk_bootstrap']['package']['chefdk_julia']
chef_gem 'chefdk-julia'

# TODO: add the config to enable julia in knife.rb/config.rb
# TODO: Rip out all traces of chef julia
end
2 changes: 1 addition & 1 deletion recipes/conemu.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions recipes/fix_profile.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,7 @@

username = ENV['username']

case node['platform_family']
when 'windows'
if platform_family?('windows')
file "C:\\Users\\#{username}\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1" do
content ''
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/git.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/gitconfig.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Nordstrom, Inc.
# Copyright:: 2018 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/gitextensions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/iterm2.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/kdiff3.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
7 changes: 3 additions & 4 deletions recipes/mac_os_x.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,12 +14,11 @@
#

home = Dir.home(ENV['SUDO_USER'] || ENV['USER'])
%W[
%W(
#{home}/.chef
#{home}/chef
#{home}/chef/cookbooks
/usr/local
].each do |dir|
).each do |dir|
directory dir do
owner ENV['SUDO_USER'] || ENV['USER']
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/poshgit.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/powershell_profile.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/vagrant.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion recipes/virtualbox.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions recipes/windows.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,11 +16,11 @@
include_recipe 'chocolatey'

home = Dir.home
%W[
%W(
#{home}/.chef
#{home}/chef
#{home}/chef/cookbooks
].each do |directory|
).each do |directory|
directory directory
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/bootstrap_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2016 Nordstrom, Inc.
# Copyright:: 2016 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,26 +30,26 @@

context 'long options' do
let(:arguments) do
%w[--json-attributes http://server/attributes.json --version 0.14.25]
%w(--json-attributes http://server/attributes.json --version 0.14.25)
end

it 'all long options specified' do
options = {
json_attributes: 'http://server/attributes.json',
version: '0.14.25'
version: '0.14.25',
}
expect(cli.parse).to eq(options)
end
end

context 'short options' do
let(:arguments) { %w[-j http://server/attributes.json -v 0.14.25] }
let(:arguments) { %w(-j http://server/attributes.json -v 0.14.25) }

it 'all short options specified' do
options =
{
json_attributes: 'http://server/attributes.json',
version: '0.14.25'
version: '0.14.25',
}
expect(cli.parse).to eq(options)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/atom_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016 Nordstrom, Inc.
# Copyright:: 2016 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/recipes/bash_profile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016 Nordstrom, Inc.
# Copyright:: 2016 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
include_context 'mac_os_x'

before do
%w[http_proxy https_proxy no_proxy].each do |proxy_var|
%w(http_proxy https_proxy no_proxy).each do |proxy_var|
ENV.delete(proxy_var)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/chefdk_julia_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Nordstrom, Inc.
# Copyright:: 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 91b2b0c

Please sign in to comment.