tools: format checks for backticks#17566
Conversation
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
| # Make sure backticks come in pairs. | ||
| # Exceptions: reflinks (ref:`` where the backtick won't be preceded by a space | ||
| # links `title <link>`_ where the _ is checked for in the regex. | ||
| BAD_TICKS_REGEX = re.compile(r".* `[^`].*`[^_]") |
There was a problem hiding this comment.
im wondering will this work across lines ?
There was a problem hiding this comment.
It should - AFIK the rst script collects a line's worth of data in line and only then does checks like "does this release note have a terminal period"
It will miss things like (header name) so it's still best effort but IMO better than nothing.
There was a problem hiding this comment.
yep, for sure
the reason i hadnt added this previously is that a line regex wont catch situations like
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec porttitor tellus, commodo tincidunt elit. ``Nullam
auctor neque`` pulvinar ipsum congue, a lacinia nulla sagittis.which i think is valid rst etc
my vague intention on this was to add a sphinx plugin that hooked in to the "default role" (i think that is what its called in rstspeak) and errored
but, yep, this should catch most i think
phlax
left a comment
There was a problem hiding this comment.
lgtm, thanks @alyssawilk
i was gonna ask why it wasnt erroring with so many of these in the code base - and then i remmed that this is only checking this one file atm
i can follow up to look at enabling this for more/the rest of the rst code
…bridge-stream * upstream/main: (32 commits) tls: move ssl connection info into SocketAddressProvider (envoyproxy#17334) conn pool: default enable runtime feature `conn_pool_delete_when_idle` (envoyproxy#17577) api: LEDS api introduction (envoyproxy#17419) kafka: add support for api versions request in mesh-filter (envoyproxy#17475) ext_proc: Implement BUFFERED_PARTIAL processing mode (envoyproxy#17531) tooling: Async/pathlib/mypy cleanups and utils (envoyproxy#17505) xds: restructure CertificateProvider fields (envoyproxy#17201) Refactor OverloadIntegrationTest breaking out a test base, and the fake resource monitors. (envoyproxy#17530) listener: move active connection collection out of active tcp listener (envoyproxy#16947) tools: format checks for backticks (envoyproxy#17566) coverage: set lower limit for common/quic and common (envoyproxy#17573) v2: final source removal (envoyproxy#17565) test: bumping coverage (envoyproxy#17564) quic: enforcing header size and contents (envoyproxy#17520) Support for canonicalizing URI properly for AWS SigV4 signer (envoyproxy#17137) listener: add a stat for transport socket connect timeout (envoyproxy#17458) listener: add listen() error handling (envoyproxy#17427) http: return per route config when direct response is set (envoyproxy#17449) removing most v2 references from source/ (envoyproxy#17415) bug fix: return bootstrap when validating config (envoyproxy#17499) ... Signed-off-by: Garrett Bourg <bourg@squareup.com>
Risk Level: n/a (tooling only) Testing: against current, 1.19.0 Docs Changes: n/a Release Notes: n/a Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Risk Level: n/a (tooling only)
Testing: against current, 1.19.0
Docs Changes: n/a
Release Notes: n/a