slather 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8060102a85e060f09791423c1b509c567f9f591b9d74876fb569dd39ff0cad0
4
- data.tar.gz: a329264218fd8df751c96c3ff91fa8f12d56a3f1c832ed5d9f8e9c18089a5ffe
3
+ metadata.gz: 05adf16363e34b66c94cd7429e974358c3db5ec6da5e793ff5153a9502e44748
4
+ data.tar.gz: 6427c7163b3d175f79c9c4b02f192254081932787a9ac81c4b3ea5bd012112c6
5
5
  SHA512:
6
- metadata.gz: 685c7f692735063e4840e858a2c71c27298a25c066f1e503758cf89ba6e9d1b8e4a255f168e5633c8a51e91de4832927d82ebba4d2564176304830cfc56050b3
7
- data.tar.gz: 453a3c0a5623c9a8feb4b28d9a73c47cbfaa6e5cb954ec33efb5eafab109ec8e46308d83186a9290ab3433306cac9f68e28c6899b54dba29b0c8823827d30ca3
6
+ metadata.gz: d95ef950d4cdc027a1b2f3bc961523d5e58d86014a1595c9cee9a47cbd7ab6ff025952080aa443f0c790b4df9dc1289aa8ec053c71c42a906ced810f29da53a2
7
+ data.tar.gz: 5504fd56de51e429d949652da30fc5ac5684a6ad6edc2f4964effc90d6f824e83a6584f0e66f866bc81ab927c9c50e8c21fbdee70780d48473c1c4302818b443
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v2.8.1
4
+
5
+ * cobertura.sourceforge.net should use https instead of http
6
+ [jarrodlombardo-EventBase](https://github.com/jarrodlombardo-EventBase)
7
+ [#559](https://github.com/SlatherOrg/slather/pull/559)
8
+
9
+ * Handle include globs
10
+ [dnedrow](https://github.com/dnedrow)
11
+ [#553](https://github.com/SlatherOrg/slather/pull/553)
12
+
3
13
  ## v2.8.0
4
14
 
5
15
  * Add `--ymlfile` option to override `.slather.yml`
data/README.md CHANGED
@@ -88,7 +88,20 @@ Run this command to enable the `Generate Test Coverage` and `Instrument Program
88
88
  ```sh
89
89
  $ slather setup path/to/project.xcodeproj
90
90
  ```
91
+ ## General Usage Notes
92
+ ### Commandline Arguments Win
93
+ When using both a config file (`.slather.yml`) and providing arguments via the commandline,
94
+ the arguments will take precedence over the matching setting in the config file.
91
95
 
96
+ ### `ignore` always wins over `source-files`
97
+ When defining both files that should be ignored (`--ignore`, ignore) and source files to include (`--source-files`, source_files),
98
+ 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
99
+ source_file list is not checked.
100
+
101
+ If the file being scanned is not in the ignore list, and source_file has been defined, the source_file list is
102
+ checked. If the source file matches a glob, it will be included.
103
+
104
+ ## CI Integration
92
105
  ### Usage with Codecov
93
106
 
94
107
  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).
@@ -80,5 +80,11 @@ module Slather
80
80
  end
81
81
  end
82
82
 
83
+ def include_file?
84
+ project.source_files.any? do |include|
85
+ File.fnmatch(include, source_file_pathname_relative_to_repo_root)
86
+ end
87
+ end
88
+
83
89
  end
84
90
  end
@@ -171,7 +171,7 @@ module Slather
171
171
  xml.doc.create_internal_subset(
172
172
  'coverage',
173
173
  nil,
174
- "http://cobertura.sourceforge.net/xml/coverage-04.dtd"
174
+ "https://cobertura.sourceforge.net/xml/coverage-04.dtd"
175
175
  )
176
176
  xml.coverage do
177
177
  xml.sources do
@@ -246,16 +246,15 @@ module Slather
246
246
  private :supported_file_extensions
247
247
 
248
248
  def ignored?
249
- # This indicates a llvm-cov coverage warning (occurs if a passed in source file
250
- # is not covered or with ccache in some cases).
251
- ignore = source_file_pathname.to_s.end_with? "isn't covered."
249
+ path = source_file_pathname.to_s
252
250
 
253
- if !ignore
254
- # Ignore source files inside of platform SDKs
255
- ignore = (/Xcode.*\.app\/Contents\/Developer\/Platforms/ =~ source_file_pathname.to_s) != nil
256
- end
251
+ # This indicates a llvm-cov coverage warning (occurs if a passed in source file
252
+ # is not covered or with cache in some cases).
253
+ return true if path.end_with?("isn't covered.")
254
+ # Ignore source files inside of platform SDKs
255
+ return true if path.include?("/Xcode.*\.app\/Contents\/Developer\/Platforms")
257
256
 
258
- ignore ? ignore : super
257
+ super
259
258
  end
260
259
  end
261
260
  end
@@ -185,7 +185,7 @@ module Slather
185
185
  if paths_to_segments.key?(coverage_file.source_file_pathname)
186
186
  coverage_file.segments = paths_to_segments[coverage_file.source_file_pathname]
187
187
  end
188
- !coverage_file.ignored? ? coverage_file : nil
188
+ !coverage_file.ignored? && coverage_file.include_file? ? coverage_file : nil
189
189
  end.compact
190
190
  end
191
191
  private :create_coverage_files
@@ -341,6 +341,7 @@ module Slather
341
341
  configure_arch
342
342
  configure_binary_file
343
343
  configure_decimals
344
+ configure_source_files
344
345
 
345
346
  self.llvm_version = `xcrun llvm-cov --version`.match(/LLVM version ([\d\.]+)/).captures[0]
346
347
  rescue => e
@@ -380,6 +381,10 @@ module Slather
380
381
  self.ignore_list ||= [(self.class.yml["ignore"] || [])].flatten
381
382
  end
382
383
 
384
+ def configure_source_files
385
+ self.source_files ||= [(self.class.yml["source_files"] || [])].flatten
386
+ end
387
+
383
388
  def configure_ci_service
384
389
  self.ci_service ||= (ENV["CI_SERVICE"] || self.class.yml["ci_service"] || :other)
385
390
  end
@@ -1,3 +1,3 @@
1
1
  module Slather
2
- VERSION = '2.8.0' unless defined?(Slather::VERSION)
2
+ VERSION = '2.8.1' unless defined?(Slather::VERSION)
3
3
  end
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0"?>
2
- <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
2
+ <!DOCTYPE coverage SYSTEM "https://cobertura.sourceforge.net/xml/coverage-04.dtd">
3
3
  <coverage line-rate="0.7500000000000000" branch-rate="0.6410256410256411" lines-covered="60" lines-valid="80" branches-covered="25" branches-valid="39" complexity="0.0" timestamp="1614041230" version="Slather 2.6.1">
4
4
  <sources>
5
5
  <source>/Users/hborawski/sandbox/slather</source>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slather
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-12 00:00:00.000000000 Z
11
+ date: 2024-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  - !ruby/object:Gem::Version
342
342
  version: '0'
343
343
  requirements: []
344
- rubygems_version: 3.4.10
344
+ rubygems_version: 3.5.4
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: Test coverage reports for Xcode projects