-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
During docs builds, leave newsfragments unchanged #3086
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3086 +/- ##
==========================================
+ Coverage 99.59% 99.60% +0.01%
==========================================
Files 121 121
Lines 17882 17882
Branches 3214 3214
==========================================
+ Hits 17809 17811 +2
+ Misses 51 50 -1
+ Partials 22 21 -1 |
Looks good! Though I just realized a different way of achieving this that's perhaps even better/simpler - move the |
That would check syntax, but this way lets you fully preview how the changelog would appear in context. Sphinx has heaps of events, there definitely would be a way to include |
Day-to-day I usually only care about syntax, previewing in context would be if you care about the specific way towncrier incorporates the fragments. But I suppose others might find that useful at times |
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.
we can also open an issue/PR in towncrier for a command-line argument that disables staging the changelog
I want this now for working on #3081, so I'll merge it :) |
Works great! One downside is that the sphinx output will refer to non-existent lines, but shouldn't be very difficult to trace back to where they came from - though could cause confusion in the future if people aren't aware that this is happening behind the curtains.
|
Hmm. Actually, looking for how to solve that gave me an idea for a totally different way to do this that would simplify the git bit, and solve a few problems. We have towncrier "modify" a blank file to get the changelog it produces, then use an RST |
The downside to that would be that you now have a dangling dead file you 1. "need" to clean up, and 2. you can confuse yourself by editing the generated file instead of the original fragments, and 3. getting an error in there requires you to open the file, identify the line that caused the error, figure out which newsfragment file that corresponds to, and then go edit it. |
I was thinking the dangling file would be |
Fixes #3084: This makes building docs include the changelog, while keeping all source files unchanged. This does that by restoring the working tree copy and any staged changes afterwards. Ideally there'd be an option to have towncrier not
git add
the changed copy, or write to another location, then we wouldn't have to restore. But this works fine.