diff options
author | Thom May <thom@chef.io> | 2016-01-12 15:00:00 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-12 15:00:00 +0000 |
commit | e3400c0b6c53c5ba11657f21abffb1f72408d4a9 (patch) | |
tree | dbd1ab964dab36596b1a7a55229b8f731530e360 | |
parent | 0944320b72ee1ab16a18a149f5ecb743ace0c0d3 (diff) | |
download | chef-e3400c0b6c53c5ba11657f21abffb1f72408d4a9.tar.gz |
Per RFC 64, do style checking of the Chef repo
This commit enables ChefStyle, but with no active cops. Cops will be
added per the RFC (one at a time, with a supporting PR to this repo) as
we go on.
-rw-r--r-- | .rubocop.yml | 3 | ||||
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | Gemfile | 3 | ||||
-rw-r--r-- | Rakefile | 7 |
4 files changed, 14 insertions, 0 deletions
diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000000..36782c7693 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,3 @@ +AllCops: + Exclude: + - "spec/data/**/*" diff --git a/.travis.yml b/.travis.yml index 078a20613a..c719407c32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ branches: # do not run expensive spec tests on PRs, only on branches script: " +bundle exec rake style; echo '--color\n-fp' > .rspec; sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers; sudo -E $(which bundle) exec rake spec; @@ -27,6 +27,9 @@ group(:development, :test) do gem "simplecov" gem 'rack', "~> 1.5.1" + # for testing new chefstyle rules + # gem 'chefstyle', github: 'chef/chefstyle' + gem 'chefstyle', '= 0.1.0' gem 'ruby-shadow', :platforms => :ruby unless RUBY_PLATFORM.downcase.match(/(aix|cygwin)/) @@ -45,6 +45,13 @@ task :register_eventlog do end end + +require "chefstyle" +require "rubocop/rake_task" +RuboCop::RakeTask.new(:style) do |task| + task.options += ["--display-cop-names", "--no-color"] +end + begin require 'yard' DOC_FILES = [ "README.rdoc", "LICENSE", "spec/tiny_server.rb", "lib/**/*.rb" ] |