-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow per-file minimum coverage #304
Open
vereis
wants to merge
4
commits into
parroty:master
Choose a base branch
from
Vetspire:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you think about adding example json definition in addition to this description? Maybe something like,
Example configuration file with nested
minimum_coverage
option:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course!
How do you feel about letting these strings also be globs? So that we could support
"lib/my_app/important_context/*"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Maybe, listing individual file might be too tedious, but supporting glob can become complex (especially when a certain file matches with multiple conditions).
One option could be, keep the original default value (global), and make this per-file value as additional exception parameter (for allowing certain files which cannot reach the globally expected coverage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah you're correct -- that is a very obvious edge case I didn't think about! Maybe not worth doing immediately then thanks 👍
We could do:
Is this what you were suggesting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry being late to respond. Yeah,
minimum_coverage_exceptions
type of the exception would make more sense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comment. I think I was misunderstanding the intention of this change (and also original
#130
issue). As you pointed out, having both valuesminimum_coverage_exceptions
andminimum_file_coverage
may not make sense.Hmm, I am getting less confident about how to define more granular threshold values (I just wondered listing out individual files would be tedious if there're many files).
Is it possible for you to elaborate what
same issues
means? (or do you have insights around how the parameters should be?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I would just keep it simple and add a global threshold definition per file and keep having a more granular configuration out of the scope for now. If there are files that don't need to be tested, most probably they are added to the
skip_files
configuration so having a general threshold might make sense at first.Nevermind, my question was related to your previous comment:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this part makes sense (relatively simple one, though it might not be perfect).
Having granular control might resolve certain scenario, but I am getting less confident whether it can kept as simple, hmm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed; I'm totally onboard with keeping it simple and adding thresholds per file as an additional thing; ignoring globbing and other more granular considerations for now.
I'll update the PR to the following:
Perhaps if we go live with something like this, we can revisit whether or not we need more granular control in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parroty I've also made a change to the
README.md
now if you'd like to take a look 🙏