Skip to content

Commit

Permalink
Update README and option desc
Browse files Browse the repository at this point in the history
  • Loading branch information
grodowski committed Dec 3, 2024
1 parent ee5c808 commit 0acec5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
```
Expand Down
9 changes: 5 additions & 4 deletions lib/undercover/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0acec5e

Please sign in to comment.