Repository navigation
Description
comment-and-doc-style "Issue, pull request, and commit references" bans naming an issue or a pull request in any comment, code comments included. Applied to a code file that ban deletes source citations, because in code the reference is not a second lookup. It is the citation for the line under it, and it is doing the same job as the datasheet link, the wiki link and the SDK doc link sitting beside it, which the same rule leaves alone.
The rule's own remedy, "write the constraint the reference was standing in for", cannot be executed on some of them at all, because the reference is the content rather than a citation beside it.
What this looks like in practice
These are the eleven instances in ptr727/ESPHome-Config, a live ESPHome /config tree. Every one sits in a YAML comment.
The citation is one of several reference links, and the others are permitted. templates/norvi-enet-ae06-r.yaml:
# ESPHome support:
## DS3231 is compatible with the DS1307
## https://github.com/esphome/feature-requests/issues/515
## https://esp-idf-lib.readthedocs.io/en/latest/groups/ds3231.html
##
## microSD card IO is not yet supported
## https://github.com/esphome/feature-requests/issues/513The banned line and the permitted line are adjacent, answer the same question, and differ only in which host serves them. archive/esp32-audio-kit-test.yaml is the same shape, a five-line bibliography where one entry is a pull request and the other four are vendor docs and a forum thread.
The citation substantiates a workaround. templates/norvi-enet-ae06-r.yaml:
# Increase speed to prevent component took a long time errors
# https://github.com/esphome/issues/issues/4717#issuecomment-1643391691
frequency: 400kHzA maintainer revisiting that frequency override needs to know whether the reported cause still stands. Nothing writable into the comment answers that, because the answer is live state in someone else's tracker.
The reference is the whole content, so the remedy has nothing to rewrite. templates/max17048.yaml:
# TODO: https://github.com/esphome/feature-requests/issues/2277and recirculation-pump-controller.yaml:
# https://github.com/esphome/issues/issues/2270
# default_mode: heatApplying the remedy here means opening two upstream issues and writing a summary of each. That is not a rewrite, it is research, and the result is a worse comment than the link: a paraphrase that goes stale silently while the link stays correct.
The reference is a safety record. garage-door-controller.yaml is a controller that is physically powered off after an opener self-opened twice. Its header comment carries the incident report, the upstream report the cause was confirmed in, and an older report of the same pattern. The block describes the mechanism in full, so nothing factual is lost by deleting them, and what is lost is the trail to whether the upstream fix has shipped.
Why the rule's three reasons do not reach this surface
- "A reference is a second lookup, and the reader is already holding the file." True where the reference stands in for a fact that could have been written down. It is false where the referenced thing is upstream status, which is not in the file, cannot be put in the file, and changes without anyone touching the file.
- "The lookup can be impossible." That reason is about a private repository's content carried into a public one. These all point at public upstream projects, exactly like a wiki or an SDK link.
- "It pollutes the content." In these files a URL line is the established idiom. Removing only the ones whose host is a forge, while keeping datasheets, vendor wikis, forum threads and
esphome.iocomponent docs, is not less pollution. It is the same line count with the useful half removed.
Proposed change
In code, and YAML is code, treat an external link naming an issue or a pull request as information rather than a violation, at most a warning. Keep the ban where the reasons do hold:
- Instruction documents keep the ban outright.
AGENTS.md,CODESTYLE.md,GOVERNANCE.mdand their siblings are prose that teaches a rule, and a citation there really is a second lookup standing in for a constraint that should have been written. The three the repository above removed fromCODESTYLE.mdandOPERATIONS.mdwere correct removals and are not asked back. - The bare spellings keep the ban everywhere,
#1234andowner/repo#1234. Those genuinely are a second lookup: they carry no destination, they resolve differently depending on which repository a reader happens to be in, and the existingissue-refrule already detects them. - A URL is the permitted spelling in code, because it names its destination, it is verifiable by anyone, and it is indistinguishable in purpose from the documentation links the rule already allows.
This interacts directly with issue #1711, which asks the gate to read link destinations so a Markdown link to a pull request stops passing. The two are consistent if that detection lands with the surface split above: an error in instruction text, information in code. Landing #1711 as a uniform error instead would make every example on this page a CI failure, which is the outcome this issue is asking to avoid.
What the downstream repository is doing meanwhile
ptr727/ESPHome-Config is keeping all eleven and stating the divergence in the commit that would otherwise have swept them. Two of them changed spelling only, from owner/repo#N to the URL form, because the bare form fails the current gate on a changed line.
Activity
ptr727 commentedon Sep 20, 2026
Accepted, and the diagnosis lands one step further than the issue puts it: the gate is already doing the defensible thing, and the rule text is what is wrong.
The gate and the rule disagree
Probed at
mainagainst a YAML file carrying all four spellings:The two upstream URL citations pass. Only the two bare forms report. So the eleven instances in
ESPHome-Configwere never failing CI, and nine of them never could have.What deleted them is the prose.
comment-and-doc-stylesays "No comment, no docstring, and no instruction document names an issue, a pull request, or a commit. The surfaces are code and workflow comments", which plainly covers a URL in a YAML comment. An agent following the rule removes a citation the gate would have allowed, which is what happened, and which no gate run would have caught either way.The rule is scoped on the wrong axis
It splits on which file. Its own three reasons split on whose tracker.
That is why the remedy is unexecutable on some of these. "Write the constraint the reference was standing in for" has nothing to rewrite when the referenced thing is upstream status.
The decided shape
#1234andowner/repo#1234, as this issue itself proposes. They name no destination and resolve against whichever repository the reader happens to be in.On the interaction with #1711
That issue asks the gate to read link destinations so a Markdown link to a pull request stops passing. The direction recorded there already scopes the detection to instruction text only, so it does not turn any example on this page into a failure. The two are landing in one pull request together with #1710, because #1711 without this surface split is exactly the uniform error this issue asks to avoid, and one review loop should judge that coupling rather than two loops each seeing half of it.
On the downstream divergence
Keeping all eleven and stating the divergence was the right call. The two changed from
owner/repo#Nto the URL form stay changed, since the bare-form ban holds under this shape too.Scope the Reference Ban on Whose Tracker, and Read a Configuration Bl…