diff options
author | Thom May <thom@may.lt> | 2016-01-12 16:23:09 +0000 |
---|---|---|
committer | Thom May <thom@may.lt> | 2016-01-12 16:23:09 +0000 |
commit | d223b8bab095567c832dd6fe14f4068228da6c87 (patch) | |
tree | c3112c18053a232d8ab7f261d804f82962fbbf5f | |
parent | 0944320b72ee1ab16a18a149f5ecb743ace0c0d3 (diff) | |
parent | 80cc0467f69f1e27a96bf11e4177bacf9d9a8e98 (diff) | |
download | chef-d223b8bab095567c832dd6fe14f4068228da6c87.tar.gz |
Merge pull request #4379 from chef/tm/add_chefstyle
Per RFC 64, do style checking of the Chef repo
-rw-r--r-- | .rubocop.yml | 4 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Gemfile | 3 | ||||
-rw-r--r-- | Rakefile | 7 |
4 files changed, 16 insertions, 0 deletions
diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000000..c4272bd0f4 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,4 @@ +AllCops: + Exclude: + - "spec/data/**/*" + - "vendor/**/*" diff --git a/.travis.yml b/.travis.yml index 078a20613a..cd91884f68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ branches: # do not run expensive spec tests on PRs, only on branches script: " +set -e; +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" ] |