After upgrading to Ubuntu 22.04 with Python 3.10.6, the script crashes
with
AttributeError: module 'urllib' has no attribute 'parse'
Apparently the import was wrong all along, but some quirk of the older
system allowed it to work previously.
When merging, I sometimes leave *.orig files behind, and inspect_links
starts yelling about a lot of duplicate links. A little tweak to the
regex fixes that.
Editors or contributors who want to make changes to the issue formatting
or some of the boilerplate text will probably look in the draft/
directory first-- this makes the template file very obvious, so
hopefully changes will be made there instead of (or in addition to) the
weekly draft.
Links collected from Discord will sometimes be truncated to exactly 70
characters including a "..." suffix. If the script sees a title like
this, raise a warnings as it's probably truncated and should be
corrected.
If we're unlucky enough to trigger this warning by mistake, here are
some workarounds:
- Make any change to the title so that it's not exactly 70 characters
(e.g. add an extra space between words)
- Replace the "..." with unicode "…"
The create_draft script will now search for a previous issue (under
draft and content) and then search that file for a range of lines that
look like the events list, and copy those lines over to the new draft
file.
If it has trouble finding the previous issue file, or can't find the
events list, it will print a warning and then leave a placeholder
comment in the draft issue where the events list should go.
It's easier (and less error-prone--ask me how!) to replace a single-line comment with the RFC & FCP content each week. Thanks @ericseppanen for the template upgrade!
The behavior was supposed to be:
> If no input date is specified, we assume that this will be run ~7 days
> before the next issue is released. Just in case an issue comes out
> early or late, we'll pick the Wednesday that is between 4 and 10 days
> in the future.
The code didn't actually do that though. Add the missing 4-day delta so
it works the way it was intended.
Instead of requiring the user to run this script from a specific
directory, compute the draft path from the location of the running
script. This means if you run the script from the tools/ directory (or
anywhere else), it will do the right thing.
Adds a commandline option to override the default path.
When checking for duplicate links:
- Assume http and https links to be the same.
- Ignore consecutive slashes and trailing slashes.
Consecutive slashes in the URL will trigger a warning; trailing slashes
or http links will not.
The Markdown module will sometimes emit nothing when it's confused by
the input syntax; therefore <li></li> is a sign that perhaps something
went wrong.
The markdown syntax allows un-escaped < > characters to be emitted in
the html output. This is probably undesirable, as something like Vec<T>
will be interpreted as a tag.
This file imports some code from inspect_links, which might be a bad
design; separating "CLI tool" from "library" code is left for a future
commit.
In CI, stdout and stderr are interleaved weirdly, making the output
hard to read. To fix this, don't log messages to both-- just use stdout
for everything.
Since old warnings are now silenced by default, it's easy to look
farther back in time for recycled links. 25 is probably a reasonable
number (~6 months).
Add the ability to only report on the N most recent issues, with N
defaulting to 1. This is probably what most people want, most of the
time (including in CI).
Allow a list of paths on the command-line, separated by colons. The
default set of paths is 'content:draft' which seems to work with the
current PR workflow.
Make the "strict" check smarter by allowing an 'h2' section policy to
apply to all subsections inside.
Change the (hardcoded) policy so that everything inside the "Updates
from Rust Community" gets strict checks.
Instead of allow-listing sites that need http parameters, filter out
known analytics tracking parameters.
There's also a nice side-effect to re-constituting the URL using
urllib.parse.unsplit(): oddities like an empty anchor (trailing '#') or
empty parameter-list (trailing '?') can be flagged.
This script checks for malformed and duplicated links. The goal would be
to run it in CI to save the editors from the job of noticing that a link
isn't formatted correctly, or was submitted multiple times.