-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add tag_filter config option #69
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
Conversation
If this looks helpful, I'll make sure the formatting/docs/tests are fixed up. |
Codecov ReportBase: 93.19% // Head: 92.92% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #69 +/- ##
==========================================
- Coverage 93.19% 92.92% -0.27%
==========================================
Files 1 1
Lines 382 410 +28
Branches 61 65 +4
==========================================
+ Hits 356 381 +25
- Misses 22 24 +2
- Partials 4 5 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Hi, thank you for your contribution! I see here 2 ways to implement that:
Also I'm not sure about implicit change of default value of |
@dolfinus do you have a preference between option 1 and option 2? I don't think the regexp is required anymore for what I'm trying to do, so option 1 would be sufficient for what I need. Option 2 is definitely more flexible. I wasn't sure about the implicit default value change for tag_formatter either, but it definitely simplifies things for the user when it works. (and conversely, makes things more confusing if it doesn't!). I suppose rather than doing that, it could just be listed in the docs as a recommendation if you're using a simple tag_prefix. |
I prefer option 2, it is more flexible, and also consistent with other options already present in the project. Regarding |
Sounds good - I'll make the adjustments |
The tag_filter option allows one to filter the list of tags using either a regexp or a callback, similar to the tag_formatter option. This is helpful in monorepos where many product's tags exist.
1975f1b
to
91d6bf5
Compare
None is a valid return value.
b72f605
to
079c862
Compare
Also fix a couple spots that still had just `str` as the return type Adjust docs
2aab8b6
to
755acac
Compare
Squashed the history down to make this a bit cleaner - just the |
filter_fxn -> filter_callback
If the date param is set, use it to set the GIT_COMMITTER_DATE environment variable. This ensures the commit order when using the `creatordate` sort order, and eliminates the need for the time.sleep(1) in some of the tests.
Remove unnecessary time.sleep(1) calls - this speeds up the test significantly. Remove different asserts in `test_tag_sort_by_tag_date()` - with the commit date set, the results are now consistent.
This just removes the tags that don't match from the list of tags, which is how it was supposed to work originally.
Create tag in same loop as commit it test_tag_filter() Use same function for filter and formatter in test_tag_filter_external()
Ok @dolfinus, see what you think of that changeset. Note that the |
Not sure what I was thinking before, but this needs to be just the ISO 8601 formatted date string, not a ``--date`` option
Done while debugging, and forgot to revert
Test was busted because of the broken committer date fix in util.py. Now that the committer date is fixed, this works again with the original, correct code.
Fixed conflict on get_tags() in setuptools_git_versioning.py
load_callable -> _load_callable
Internal function prefixed with `_` now
@dolfinus - ok, addressed your comments on the latest patchset, and I think the code conforms to the changes you just made in master. The code coverage fails because the tests don't hit the case in |
Thank you, I'll check what can be done with coverage |
tag_filter
lets one specify either a regexp or a callback to filter which tags are considered. This is helpful in monorepos where many product tags exist.Potential fix for #68