Repository navigation
PHPAY-124: verificador de links no gate e a quebra da documentação no changelog - #125
Merged
Merged
Conversation
The documentation is 17 files since the README was split, and the links between them are relative. A relative link breaks in silence: markdown does not complain, PHPStan does not look at it, and GitHub only shows the 404 to whoever clicks. The script checks that every relative link points at something that exists, and that every #anchor matches a heading that really produces it. A heading inside a code block does not count — that is exactly how the unclosed fence in the Cielo example stayed hidden for months, taking ten links of the table of contents with it, and a checker that ignored fences would have said everything was fine. It runs as composer test:links, inside composer test, and as a step of the quality job. Verified to fail: a file that does not exist and an anchor that does not exist both come back with the file and line, and the exit code is 1.
The Não lançado section had the CI work from PHPAY-111 but not the README split, which is the change a user can feel: an external link to an anchor of the old README stopped working. Also recorded from the same PR: the capability matrix gaining the webhook signature column it had been missing since v2.3.0, the code fence that made the README render inverted from Rede down to Efí, and the dead link in SUPPORT.md.
CLAUDE.md described composer test as lint + unit + types and did not mention the new script. It is the file an agent reads before touching this repository, so a stale command list there is worse than in the README.
Collaborator
Author
|
Acrescentei um terceiro commit: o |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #124.
1. Verificador de links no gate
composer test:links, em.github/scripts/check-links.php, ao lado dosmoke.php. Entra nocomposer teste num passo do job de qualidade do CI.Para cada link que não é
http(s)/mailto/tel: o arquivo (ou pasta) apontado tem que existir, e se o link traz#âncora, algum título daquele arquivo tem que gerar essa âncora pela regra do GitHub.Título dentro de bloco de código não conta como título. Não é detalhe de implementação: foi exatamente assim que a cerca não fechada no exemplo da Cielo passou meses escondida — o
### Redevirou código e levou dez links do sumário com ele. Um verificador que ignorasse as cercas teria dito que estava tudo bem.Provei que ele reprova, porque verificador que nunca falha não serve de nada. Com um arquivo temporário contendo um link para arquivo inexistente e outro para âncora inexistente:
No estado atual do repositório:
2. A quebra da documentação no changelog
A seção
[Não lançado]tinha o trabalho de CI do #112 mas não o #114, e o #114 é o que quem usa sente: link externo para âncora do README antigo deixou de funcionar. Entrou emAlterado, junto com a coluna de assinatura de webhook que faltava na matriz, e emCorrigidoo fence quebrado e o link morto doSUPPORT.md. Mais as definições de link[#113],[#114]e[#124].Como testar
composer test— agora com quatro etapas:composer validatesegue dizendo que ocomposer.jsoné válido, e ocomposer.locknão precisou ser tocado:scriptsnão entra no content-hash.Os dois commits foram verificados um por um com o gate completo.
Checklist
composer testpassa (Pint, Pest e PHPStan nível 9)Nada em
src/. O gate ficou um passo mais longo — o verificador roda em menos de um segundo.