Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Provide ability to disable style and documentation checks from within the RakeTask #9

Merged
merged 1 commit into from

2 participants

@dlindahl

The CLI allows one to turn off style and documentation checks.

The RakeTask does not provide this feature.

This pull request adds that feature to the RakeTask.

@xaviershay xaviershay merged commit 105dbb5 into square:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 29, 2012
  1. @dlindahl
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +1 −0  README.md
  2. +7 −0 lib/cane/rake_task.rb
View
1  README.md
@@ -72,6 +72,7 @@ It works just like this:
Cane::RakeTask.new(:quality) do |cane|
cane.abc_max = 10
cane.add_threshold 'coverage/covered_percent', :>=, 99
+ cane.no_style = true
end
task :default => :quality
View
7 lib/cane/rake_task.rb
@@ -10,6 +10,7 @@ module Cane
# Cane::RakeTask.new(:quality) do |cane|
# cane.abc_max = 10
# cane.doc_glob = 'lib/**/*.rb'
+ # cane.no_style = true
# cane.add_threshold 'coverage/covered_percent', :>=, 99
# end
class RakeTask < ::Rake::TaskLib
@@ -21,10 +22,14 @@ class RakeTask < ::Rake::TaskLib
attr_accessor :abc_max
# Glob to run style checks over (default: "{lib,spec}/**/*.rb")
attr_accessor :style_glob
+ # TRUE to disable style checks
+ attr_accessor :no_style
# Max line length (default: 80)
attr_accessor :style_measure
# Glob to run doc checks over (default: "lib/**/*.rb")
attr_accessor :doc_glob
+ # TRUE to disable doc checks
+ attr_accessor :no_doc
# Max violations to tolerate (default: 0)
attr_accessor :max_violations
@@ -54,8 +59,10 @@ def options
:abc_glob,
:abc_max,
:doc_glob,
+ :no_doc,
:max_violations,
:style_glob,
+ :no_style,
:style_measure
].inject(threshold: @threshold) do |opts, setting|
value = self.send(setting)
Something went wrong with that request. Please try again.