This repository has been archived by the owner on Oct 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Force code coverage for cases where a literal value is returned. #122
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* master: Fix typo in changelog. (#139) Prepare 0.2.0 release. (#138) Update deps-of-dependencies. (#137) Upgrade to excoveralls 0.11.2. (#136) Update Credo to 1.1.3. (#135) Share code for finding working tree in plumbing command modules. (#134) [API BREAKING] Merge ValidateObject into Object. (#132) Fix up a couple of type specs that should have used FilePath.t. (#131) Introduce `stage` type for index file stage references. (#130) [API BREAKING] Refactor file path code into new module Xgit.Core.FilePath (#129) Introduce a common data type for less-than / equal / greater-than comparisons. (#128) Prepare 0.1.6 release. (#127) Correct @SPEC for WorkingTree.update_dir_cache/3. (#126) Implement Xgit.Plumbing.UpdateIndex.CacheInfo. (#125) Fix a couple of bugs I noticed in update_dir_cache. (#124) Implement Xgit.Repository.WorkingTree.update_dir_cache/3. (#123) # Conflicts: # lib/xgit/core/dir_cache.ex
…nd Credo happy with this odd code.
Shocker: We have new coverage gaps.
Punt on coverage for the I/O error in mid-file case.
Side benefit: I understand the code (ported from jgit) better now.
1 task
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For now, consider this an experiment meant to provoke discussion about code coverage, rather than something meant to be merged right now.
It's been discussed a few times that code coverage tools do not see lines where a literal value are not flagged as executable lines. To wit:
This is an attempt to fix this problem. I'll start by flagging it as "hacky," but – as a library author – I do want visibility into the numerous branches that would otherwise be hidden by this behavior. (Dare I call it a bug?)
I'm hoping that somebody can point me to a "better" solution that doesn't involve compromising on meaningful code coverage.
As an example, look at https://coveralls.io/builds/25338034/source?filename=lib/xgit/core/dir_cache.ex.
See lines 187, 213, 247, … – All of those are marked as executable and when tested locally via this PR.
Checklist
All applicable changes have been documented.n/aAny code ported from jgit maintains all existing copyright and license notices.n/aIf new files are ported from jgit, the path to the corresponding file(s) is included in the header comment.n/aAnyn/aTO DO
items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.