From 0acec5e58ced48c12c28239a20285aa408da5483 Mon Sep 17 00:00:00 2001 From: Jan Grodowski Date: Tue, 3 Dec 2024 22:40:08 +0100 Subject: [PATCH] Update README and option desc --- README.md | 6 ++++-- lib/undercover/options.rb | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 97f907d..f5d9a08 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![logo](https://github.com/grodowski/undercover/assets/4991698/c4bf038b-4472-4406-8f1f-5ddc812908d6) -`undercover` warns about methods, classes and blocks that **were changed without tests**, to help you easily find untested code and reduce the number of bugs. It does so by analysing data from git diffs, code structure and SimpleCov coverage reports. +`undercover` warns about methods, classes and blocks that **were changed without tests**, to help you easily find untested code and reduce the number of bugs. It does so by analysing data from git diffs, code structure and SimpleCov coverage reports. Works with any Ruby CI pipeline as well as locally as a CLI. @@ -104,12 +104,14 @@ A few options exist to provide automated comments from `undercover` in Pull Requ Options can be passed when running the command from the command line: ```sh -undercover -h Usage: undercover [options] -l, --lcov path LCOV report file path -p, --path path Project directory -g, --git-dir dir Override `.git` with a custom directory -c, --compare ref Generate coverage warnings for all changes after `ref` + -r, --ruby-syntax ver Ruby syntax version, one of: current, ruby18, ruby19, ruby20, ruby21, ruby22, ruby23, ruby24, ruby25, ruby26, ruby30, ruby31, ruby32, ruby33 + -f, --include-files globs Include files matching specified glob patterns (comma separated). Defaults to '*.rb,*.rake,*.ru,Rakefile' + -x, --exclude-files globs Skip files matching specified glob patterns (comma separated). Empty by default. -h, --help Prints this help --version Show version ``` diff --git a/lib/undercover/options.rb b/lib/undercover/options.rb index 5093eaa..e98fa90 100644 --- a/lib/undercover/options.rb +++ b/lib/undercover/options.rb @@ -129,13 +129,14 @@ def guess_lcov_path end def file_filters(parser) - desc = 'Include files matching specified glob patterns (comma separated)' - parser.on('-f', '--include-files comma_separated_globs', desc) do |comma_separated_globs| + desc = 'Include files matching specified glob patterns (comma separated). ' \ + "Defaults to '#{DEFAULT_FILE_INCLUDE_GLOBS.join(',')}'" + parser.on('-f', '--include-files globs', desc) do |comma_separated_globs| self.glob_allow_filters = comma_separated_globs.strip.split(',') end - desc = 'Skip files matching specified glob patterns (comma separated)' - parser.on('-x', '--exclude-files comma_separated_globs', desc) do |comma_separated_globs| + desc = 'Skip files matching specified glob patterns (comma separated). Empty by default.' + parser.on('-x', '--exclude-files globs', desc) do |comma_separated_globs| self.glob_reject_filters = comma_separated_globs.strip.split(',') end end