@@ -282,32 +282,83 @@ to the standard library). The file name itself should be in the format
282282As a result, a file name can look something like
283283``Misc/NEWS.d/next/Library/2017-05-27-16-46-23.gh-issue-12345.Yl4gI2.rst ``.
284284
285+ .. _news-entry-writing :
286+
285287How to write a NEWS entry
286288-------------------------
287289
288290All ``NEWS `` entries end up being part of the changelog.
289291The changelog contains *a lot * of entries,
290292and its intended audience is mainly users, not core devs and contributors.
291- Take this into consideration when wording your ``NEWS `` entry.
292- Describe the user-visible effects of your change succinctly and accurately;
293- avoid long technical elaborations, digressions, and do not expect or require
294- the reader to have read the actual diff for the change.
295-
296- The contents of a ``NEWS `` file should be valid reStructuredText. An 80 character
297- column width should be used. There is no indentation or leading marker in the
298- file (for example, ``- ``). There is also no need to start the entry with the issue
299- number since it is part of the file name. You can use
300- :ref: `inline markups <rest-inline-markup >` too. Here is an example of a ``NEWS ``
301- entry:
293+ Readers scan it to find out whether an upgrade affects them,
294+ or to track down the change behind a new behaviour.
295+ They will not read the issue or the diff, so the entry must stand alone.
296+
297+ Keep it short
298+ ^^^^^^^^^^^^^
299+
300+ A good ``NEWS `` entry is one sentence. Two is the limit.
301+ If you need more than that to describe the change,
302+ it is probably a candidate for "What's New in Python" instead,
303+ where there is room to elaborate.
304+
305+ * Start with a verb in the imperative mood that says what kind of change
306+ it is: *Fix *, *Add *, *Remove *, *Deprecate *, *Allow *, *Raise *.
307+ * Name what changed, using :ref: `inline markup <rest-inline-markup >`
308+ such as :rst:role: `:func: <py:func> `, :rst:role: `:class: <py:class> `
309+ or :rst:role: `:mod: <py:mod> `, so readers can jump to the documentation.
310+ * Say what a user will notice, and under which conditions.
311+ * Stop.
312+
313+ Leave out:
314+
315+ * the issue or pull request number (it is already in the file name)
316+ * implementation details and the root cause of a bug
317+ * what happened before the change, if the fix already implies it
318+ * how the problem was found, or who reported it
319+ * tests that were added or changed
320+ * benchmark figures, unless the change is a performance improvement
321+ * filler such as "improves robustness" or "makes the code cleaner"
322+ * phrases that refer to the pull request itself, such as "this PR"
323+ or "this change"
324+
325+ Attribution is optional. If you want it, add it as a final sentence
326+ in the form ``Patch by Your Name. `` and name only yourself.
327+
328+ Examples
329+ ^^^^^^^^
330+
331+ A typical entry:
302332
303333.. code-block :: rst
304334
305- Fix warning message when :func:`os.chdir` fails inside
306- :func:`test.support.temp_cwd`. Contributed by Chris Jerdonek.
335+ Fix :class:`logging.handlers.TimedRotatingFileHandler` permanently stopping
336+ rollover after a rollover failed or its backup file already existed, for
337+ example at a DST change.
338+
339+ The same change, with too much detail:
340+
341+ .. code-block :: rst
307342
308- The inline Sphinx roles like :rst:role: `:func: <py:func> ` can be used help readers
309- find more information. You can build HTML and verify that the
310- link target is appropriate by using :ref: `make html <building-using-make >`.
343+ Fix :class:`logging.handlers.TimedRotatingFileHandler` so that it keeps
344+ rolling over after a rollover fails or finds that the backup file already
345+ exists, for example after a DST change. Previously the handler stopped
346+ rolling over permanently, so the base log file grew without bound and old
347+ backups were no longer removed.
348+
349+ Nothing in the second version is wrong, but the second sentence only
350+ restates the bug that the first sentence already says is fixed.
351+ A reader who wants that level of detail can follow the issue link
352+ in the changelog.
353+
354+ Format
355+ ^^^^^^
356+
357+ The contents of a ``NEWS `` file should be valid reStructuredText,
358+ wrapped at 80 characters. There is no indentation or leading marker in the
359+ file (for example, ``- ``), and no need to start with the issue number.
360+ You can build HTML and verify that the link targets are appropriate
361+ by using :ref: `make html <building-using-make >`.
311362
312363
313364Copyrights
0 commit comments