From 6ebde7c154174effc234c951aad147d881ba7df8 Mon Sep 17 00:00:00 2001 From: mlange-42 Date: Thu, 6 Feb 2025 01:22:06 +0100 Subject: [PATCH] Don't warn on missing self arg docs, also for traits --- CHANGELOG.md | 4 ++++ internal/document/document.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c3df0e..9b830354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * Adds automatic linking from doc pages to the containing module's source (#195) * Adds flag `--config` to all commands, for working with an alternative config file (#202) +### Bugfixes + +* Don't warn on missing self arg docs, also for traits (#210) + ### Other * Doc-tests parser supports quadruple backticks (#194) diff --git a/internal/document/document.go b/internal/document/document.go index f237ae95..8e80306e 100644 --- a/internal/document/document.go +++ b/internal/document/document.go @@ -250,7 +250,7 @@ type Arg struct { } func (a *Arg) CheckMissing(path string, stats *missingStats) (missing []missingDocs) { - if a.Name == "self" && a.Type == "Self" { + if a.Name == "self" && (a.Type == "Self" || a.Type == "_Self") { return nil } if a.Convention == "out" {