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

tools: ceph-release-notes: strip trailing punctuation #14385

Merged
merged 1 commit into from Apr 19, 2017

Conversation

Projects
None yet
2 participants
@smithfarm
Contributor

smithfarm commented Apr 7, 2017

Sometimes people put periods and whitespace at the end of their
PR/commit descriptions - strip these off for the purposes of
generating the release notes.

Signed-off-by: Nathan Cutler ncutler@suse.com

@smithfarm smithfarm added the tools label Apr 7, 2017

@smithfarm smithfarm requested a review from theanalyst Apr 7, 2017

@smithfarm

This comment has been minimized.

Contributor

smithfarm commented Apr 7, 2017

@theanalyst I see there is already a --text option to get the script to output plain text. Could your request be addressed by a script like this?

#!/bin/sh
ceph-release-notes >foo
ceph-release-notes --text >bar
@theanalyst

This comment has been minimized.

Member

theanalyst commented Apr 7, 2017

@smithfarm yeah I do that normally, but for dev. releases generally the first script itself takes a bit, and I wanted to avoid multiple calls to the scripts, but even that wouldn't help since there would be a lot of prs that need adjustment, so I guess multiple calls are unavoidable. For renaming prs, I kind of use a script like https://gist.github.com/theanalyst/fdc753a56bdb551eea2fa71a2aaa4eaa to edit a bunch of prs

@@ -195,6 +195,7 @@ def make_release_notes(gh, repo, ref, plaintext, verbose, strict, use_tags):
if use_tags:
title = split_component(title, gh, number)
title = re.sub(r'\.\s*$', '', title) # strip trailing punctuation

This comment has been minimized.

@theanalyst

theanalyst Apr 7, 2017

Member

wouldn't a normal title.strip() suffice here? (not sure if I'm missing anything though)

This comment has been minimized.

@theanalyst

theanalyst Apr 7, 2017

Member

oh I see what you're doing nvm

This comment has been minimized.

@smithfarm

smithfarm Apr 7, 2017

Contributor

Thanks! I didn't know about str.strip(chars) - nice. Done.

tools: ceph-release-notes: strip trailing punctuation and whitespace
Sometimes people put periods, whitespace, etc. at the end of their
PR/commit descriptions - strip these off for the purposes of
generating the release notes.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
@@ -195,6 +195,7 @@ def make_release_notes(gh, repo, ref, plaintext, verbose, strict, use_tags):
if use_tags:
title = split_component(title, gh, number)
title = title.strip(' \t\n\r\f\v\.\,\;\:\-\=')

This comment has been minimized.

@theanalyst

@theanalyst theanalyst merged commit 0eae8d3 into ceph:master Apr 19, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment