Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: false-positive deprecation warning when the "Deprecated:" sentence does not start a paragraph #46913

Closed
bcmills opened this issue Jun 24, 2021 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite

Comments

@bcmills
Copy link
Contributor

bcmills commented Jun 24, 2021

What is the URL of the page with the issue?

https://beta.pkg.go.dev/go/importer#ForCompiler

What is your user agent?

Mozilla/5.0 (X11; CrOS x86_64 13904.55.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.102 Safari/537.36

Screenshot

image

What did you do?

Attempt to read documentation for importer.ForCompiler.

What did you expect to see?

https://golang.org/wiki/Deprecated says (emphasis mine):

To signal that an identifier should not be used, add a paragraph to its doc comment that begins with Deprecated: followed by some information about the deprecation, and a recommendation on what to use instead, if applicable.

The line that begins with Deprecated: for importer.ForCompiler is not at the start of its paragraph, so I expect it to apply only to the behavior described in that paragraph and not to the ForCompiler function overall.

What did you see instead?

The entire function is prominently marked as deprecated in the pkgsite UI.

@gopherbot gopherbot added this to the Unreleased milestone Jun 24, 2021
@jba
Copy link
Contributor

jba commented Jun 24, 2021

Whoops!

@jba jba self-assigned this Jun 24, 2021
@jba jba added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 24, 2021
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Jun 24, 2021
@findleyr
Copy link
Contributor

I was just confused by this as well (and was about halfway through filing an identical issue before I thought to search).

For reference, the heuristic used by staticcheck is here:
https://github.com/dominikh/go-tools/blob/d694aadcb1f50c2d8ac0a1dd06217ebb9f654764/analysis/facts/deprecated.go#L31

@gopherbot
Copy link

Change https://go.dev/cl/400994 mentions this issue: internal/godoc/dochtml: only recognize "Deprecated" at paragraph start

@rsc rsc unassigned jba Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants