Skip to content

Commit

Permalink
Update README with info about exclusions.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Jun 29, 2012
1 parent c914574 commit c465ba9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Expand Up @@ -48,6 +48,7 @@ Customize behaviour with a wealth of options:
--gte FILE,THRESHOLD If FILE contains a number, verify it is >= to THRESHOLD.

--max-violations VALUE Max allowed violations (default: 0)
--exclusions-file FILE YAML file containing a list of exclusions

--version Show version
-h, --help Show this message
Expand Down Expand Up @@ -91,6 +92,8 @@ on to an existing application that may already have many violations. By setting
the maximum to the current number, no immediate changes will be required to
your existing code base, but you will be protected from things getting worse.

You can also consider defining exclusions for each violation (see below).

## Integrating with SimpleCov

Any value in a file can be used as a threshold:
Expand All @@ -115,6 +118,24 @@ You can use a `SimpleCov` formatter to create the required file:

SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter

## Defining Exclusions

Occasionally, you may want to permanently ignore specific cane violations.
Create a YAML file like so:

abc:
- Some::Fully::Qualified::Class.some_class_method
- Some::Fully::Qualified::Class#some_instance_method
style:
relative/path/to/some/file.rb
relative/path/to/some/other/file.rb

Tell cane about this file using the `--exclusions-file` option:

> cane --exclusions-file path/to/exclusions.yml

Currently, only the abc and style checks support exclusions.

## Compatibility

Requires MRI 1.9, since it depends on the `ripper` library to calculate
Expand Down

0 comments on commit c465ba9

Please sign in to comment.