Skip to content

Commit

Permalink
style fix(es)
Browse files Browse the repository at this point in the history
  • Loading branch information
djoos committed Jul 27, 2021
1 parent 054b2e5 commit 9318dc5
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 67 deletions.
20 changes: 0 additions & 20 deletions .rubocop.yml

This file was deleted.

27 changes: 12 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ end
# this module groups useful git commands together
module GitCommands
def self.ensure_branch(branch = 'master')
raise '[GIT] You must specify a branch.' if branch.blank?
raise '[GIT] You must specify a branch.' if branch.empty?

return if /#{branch}/ =~ GeneralCommands.run('git rev-parse --abbrev-ref HEAD', 0, 1)
raise '[GIT] Currently working on unexpected branch'
Expand Down Expand Up @@ -197,18 +197,15 @@ module KnifeCommands
end

namespace :style do
require 'cookstyle'
require 'rubocop/rake_task'
require 'foodcritic'

desc 'Run Ruby style checks (RuboCop)'
RuboCop::RakeTask.new(:ruby)

desc 'Run Chef style checks (FoodCritic)'
FoodCritic::Rake::LintTask.new(:chef)
desc 'Run Cookstyle checks'
RuboCop::RakeTask.new(:cookstyle)
end

desc 'Run all syntax/lint checks'
task :style => ['style:ruby', 'style:chef']
task style: ['style:cookstyle']

desc 'Run ChefSpec tests'
RSpec::Core::RakeTask.new(:spec)
Expand Down Expand Up @@ -243,27 +240,27 @@ namespace :publish do
end
end

task :all => ['scm', 'chef:supermarket', 'chef:server']
task all: ['scm', 'chef:supermarket', 'chef:server']
end

desc 'Run lint checks'
task :lint => %w(style)
task lint: %w(style)

desc 'Run unit tests'
task :unit => %w(spec)
task unit: %w(spec)

desc 'Run Travis CI tests'
task :travis => %w(lint unit)
task travis: %w(lint unit)

desc 'Run all integration tests'
task :integration => %w(integration:vagrant)
task integration: %w(integration:vagrant)

desc 'Publish'
task :publish => %w(publish:scm publish:chef:supermarket publish:chef:server)
task publish: %w(publish:scm publish:chef:supermarket publish:chef:server)

desc 'Release'
task :release do
ReleaseCommands.release(environment)
end

task :default => %w(lint unit integration)
task default: %w(lint unit integration)
4 changes: 2 additions & 2 deletions attributes/composer.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Attributes:: composer
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

default['pdepend']['prefix'] = '/usr/bin'
4 changes: 2 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Attributes:: default
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

default['pdepend']['install_method'] = 'composer'
Expand Down
4 changes: 2 additions & 2 deletions attributes/phar.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Attributes:: phar
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

default['pdepend']['phar_url'] = 'http://static.pdepend.org/php/latest/pdepend.phar'
Expand Down
6 changes: 3 additions & 3 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Library:: helpers
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

# PDEPEND module
Expand All @@ -13,7 +13,7 @@ module Helpers
# Package names returned are determined by the platform running this recipe.
def pdepend_prerequisite_packages
value_for_platform(
'default' => ['libmagickwand-dev', 'libmagickcore-dev']
'default' => %w(libmagickwand-dev libmagickcore-dev)
)
end
end
Expand Down
10 changes: 2 additions & 8 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
maintainer_email '[email protected]'
license 'MIT'
description 'Installs/Configures pdepend'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.2.0'

%w(debian ubuntu redhat centos fedora scientific amazon).each do |os|
supports os
end

source_url 'https://github.com/djoos-cookbooks/pdepend' if respond_to?(:source_url)
issues_url 'https://github.com/djoos-cookbooks/pdepend/issues' if respond_to?(:issues_url)
source_url 'https://github.com/djoos-cookbooks/pdepend'
issues_url 'https://github.com/djoos-cookbooks/pdepend/issues'

depends 'php'
depends 'composer'

recipe 'pdepend', 'Installs pdepend.'
recipe 'pdepend::composer', 'Installs pdepend using composer.'
recipe 'pdepend::pear', 'Installs pdepend using pear.'
recipe 'pdepend::phar', 'Installs pdepend using phar.'
12 changes: 6 additions & 6 deletions recipes/composer.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Recipe:: composer
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

include_recipe 'composer'
Expand All @@ -12,7 +12,7 @@
directory pdepend_dir do
owner 'root'
group 'root'
mode 0755
mode '755'
action :create
end

Expand All @@ -28,10 +28,10 @@
source 'composer.json.erb'
owner 'root'
group 'root'
mode 0600
mode '600'
variables(
:version => version,
:bindir => node['pdepend']['prefix']
version: version,
bindir: node['pdepend']['prefix']
)
end

Expand Down
4 changes: 2 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Recipe:: default
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

case node['pdepend']['install_method']
Expand Down
4 changes: 2 additions & 2 deletions recipes/pear.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Recipe:: pear
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

include_recipe 'php'
Expand Down
6 changes: 3 additions & 3 deletions recipes/phar.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# Cookbook Name:: pdepend
# Cookbook:: pdepend
# Recipe:: phar
#
# Copyright (c) 2016, David Joos
# Copyright:: (c) 2016, David Joos
#

remote_file "#{node['pdepend']['install_dir']}/pdepend" do
source node['pdepend']['phar_url']
mode 0755
mode '755'
end
2 changes: 0 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'rspec/expectations'
require 'chefspec'
require 'chefspec/berkshelf'

at_exit { ChefSpec::Coverage.report! }

0 comments on commit 9318dc5

Please sign in to comment.