Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Fix sed to not capture line and function coverage #1

Merged
merged 1 commit into from
May 31, 2020
Merged

Fix sed to not capture line and function coverage #1

merged 1 commit into from
May 31, 2020

Conversation

Nef10
Copy link
Contributor

@Nef10 Nef10 commented May 30, 2020

I tried using this action but ran into a problem.

Output of lcov --list:

➜ lcov --list ~/Desktop/cov.txt                                        
Reading tracefile /Users/Steffen/Desktop/cov.txt
                                 |Lines       |Functions  |Branches    
Filename                         |Rate     Num|Rate    Num|Rate     Num
=======================================================================
[/home/runner/work/SwiftBeanCountModel/SwiftBeanCountModel/Sources/SwiftBeanCountModel/]
Account.swift                    |99.3%    136|96.7%    30|    -      0
AccountName.swift                | 100%     50| 100%     9|    -      0
Amount.swift                     | 100%     26| 100%     9|    -      0
Balance.swift                    | 100%     21| 100%     8|    -      0
Commodity.swift                  | 100%     29| 100%     7|    -      0
Cost.swift                       |47.0%    117|88.9%     9|    -      0
Custom.swift                     | 100%     24| 100%    10|    -      0
Event.swift                      | 100%     24| 100%     9|    -      0
Flag.swift                       | 100%      1| 100%     1|    -      0
Inventory.swift                  |98.4%    129|96.6%    29|    -      0
Ledger.swift                     | 100%    189| 100%    66|    -      0
MultiCurrencyAmount.swift        | 100%     60| 100%    14|    -      0
Option.swift                     | 100%     10| 100%     3|    -      0
Price.swift                      | 100%     30| 100%     9|    -      0
Tag.swift                        | 100%     10| 100%     4|    -      0
Transaction.swift                | 100%     70| 100%    13|    -      0
TransactionMetaData.swift        | 100%     26| 100%    12|    -      0
TransactionPosting.swift         | 100%     30| 100%    10|    -      0
=======================================================================
                           Total:|93.4%    982|98.8%   252|    -      0

The sed currently used parses the line and function coverage:

➜ lcov --list ~/Desktop/cov.txt | sed -n "s/.*Total:|\(.*\)%.*/\1/p"   
93.4%    982|98.8

With my fix it only parses the line coverage:

➜ lcov --list ~/Desktop/cov.txt | sed -n "s/.*Total:|\([^%]*\)%.*/\1/p"
93.4

@felangel felangel added the bug Something isn't working label May 31, 2020
Copy link
Contributor

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the contribution! 💯

@felangel felangel merged commit a3d5c9c into ChicagoFlutter:master May 31, 2020
@Nef10
Copy link
Contributor Author

Nef10 commented May 31, 2020

Thanks for the quick review!

@felangel
Copy link
Contributor

No problem! Published the fix in v1.0.2 🎉

Nef10 added a commit to Nef10/SwiftBeanCountModel that referenced this pull request May 31, 2020
My PR with the bug fix was merged, so my fork is no longer needed
see ChicagoFlutter/lcov-cop#1
Nef10 added a commit to Nef10/SwiftBeanCountModel that referenced this pull request May 31, 2020
My PR with the bug fix was merged, so my fork is no longer needed
see ChicagoFlutter/lcov-cop#1
Nef10 added a commit to Nef10/SwiftBeanCountParser that referenced this pull request May 31, 2020
My PR with the bug fix was merged, so my fork is no longer needed
see ChicagoFlutter/lcov-cop#1
Nef10 added a commit to Nef10/SwiftBeanCountParser that referenced this pull request May 31, 2020
My PR with the bug fix was merged, so my fork is no longer needed
see ChicagoFlutter/lcov-cop#1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants