-
Notifications
You must be signed in to change notification settings - Fork 122
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
build: add CLI option 'filename' #489
base: trunk
Are you sure you want to change the base?
Conversation
38caf30
to
5141972
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #489 +/- ##
==========================================
- Coverage 99.84% 99.52% -0.32%
==========================================
Files 13 13
Lines 631 635 +4
Branches 146 149 +3
==========================================
+ Hits 630 632 +2
- Partials 1 3 +2 ☔ View full report in Codecov by Sentry. |
I'm not seeing the real benefit of this. Couldn't you just pipe to a file rather than introduce another new option?
|
5141972
to
f8ebf92
Compare
@SmileyChris there are at least three reasons:
Overall, the use case I'm trying to cover is running towncrier with a filename pattern different from the one specified in the configuration and without twoncrier trying to commit any change (neither addition not removal). I considered adding an option to skip committing the file, to be used along with |
They are some solid reasons, and it does seem like a good idea. Your considerations of just going with skipping committing files was my first thought too, but I can see benefit in using the same file output system for drafts too. I think I like keeping the semantics of draft to only render the current changes, whether or not (an aside though, while using stderr may be semantically incorrect, it's still pragmatically sensible. I think it's better having stdout for only data and stderr for both error messages and - for lack of additional streams - anything else that isn't data, such as progress and status information) |
Actually, in the use case that motivated this PR, we want to always render the body of the changes without a title. We use Hence, I might have overlooked something that is changing the output when
We considered using markdown instead of restructuredtext. That would theoretically allow us to pick the body generated by towncrier and push it as the body of the GitHub Release, apart from including it in the sphinx site (through myst). The problem we found is the
Since supporting |
7c638bf
to
f2104ae
Compare
@hynek this is now ready for review! |
f2104ae
to
72c5327
Compare
With regard to the failing CI, it's complaining about the following lines not being covered: @SmileyChris, @hynek can you please help me understand? |
@umarcor coverage is configured to use branch testing. The You'll need to also ensure you're testing for the case where that |
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.
This needs more tests in order to be merged.
I am not sure that --filename
is needed for draft.
Would't be ok to just pipe the output to a file ?
towncrier build --draft > test-release.rst
@@ -0,0 +1 @@ | |||
Add CLI option ``--filename FILENAME``. |
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 think that this should inform that --filename
was added to the build sub-command, and not to all sub-commands.
Description
This PR is based on:
Add CLI option
--filename
to allow printing the drafts anywhere other thanstdout
or the location defined in the configuration.Checklist
src/towncrier/newsfragments/
. Describe yourchange and include important information. Your change will be included in the public release notes.
docs/tutorial.rst
is still up-to-date.docs/cli.rst
reflects those changes.docs/configuration.rst
reflects those changes.