From c465ba96186f4e831a05906ec56812694b08b27d Mon Sep 17 00:00:00 2001 From: Myron Marston Date: Thu, 28 Jun 2012 21:26:34 -0700 Subject: [PATCH] Update README with info about exclusions. --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 8e0fdd0..efd1418 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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: @@ -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