Skip to content

Commit

Permalink
fix: Corrected variable name
Browse files Browse the repository at this point in the history
* Use 'source_files_list' instead of 'source_files'
* Remove unnecessary console output
* The README has also been updated with additional usage notes.
  • Loading branch information
David Nedrow committed Jan 4, 2024
1 parent 2436e9a commit c066710
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,20 @@ Run this command to enable the `Generate Test Coverage` and `Instrument Program
```sh
$ slather setup path/to/project.xcodeproj
```
## General Usage Notes
### Commandline Arguments Win
When using both a config file (`.slather.yml`) and providing arguments via the commandline,
the arguments will take precedence over the matching setting in the config file.

### `ignore` always wins over `source-files`
When defining both files that should be ignored (`--ignore`, ignore) and source files to include (`--source-files`, source_files),
the ignore list is checked first. If the file being scanned matches a glob in the ignore list, it will not be included. In this case, the
source_file list is not checked.

If the file being scanned is not in the ignore list, and source_file has been defined, the source_file list is
checked. If the source file matches a glob, it will be included.

## CI Integration
### Usage with Codecov

Login to [Codecov](https://codecov.io/) (no need to activate a repository, this happens automatically). Right now, `slather` supports Codecov via **all** supported CI providers [listed here](https://github.com/codecov/codecov-bash#ci-providers).
Expand Down
2 changes: 1 addition & 1 deletion lib/slather/command/coverage_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def setup_arch
end

def setup_source_files
project.source_files = source_files if !source_files.empty?
project.source_files = source_files_list if !source_files_list.empty?
end

def setup_decimals
Expand Down
1 change: 0 additions & 1 deletion lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ def configure_ignore_list

def configure_source_files
self.source_files ||= [(self.class.yml["source_files"] || [])].flatten
puts self.source_files.to_json
end

def configure_ci_service
Expand Down

0 comments on commit c066710

Please sign in to comment.