MCPcopy Create free account
hub / github.com/github/gh-aw / getActionlintDocsURL

Function getActionlintDocsURL

pkg/cli/actionlint.go:51–80  ·  view source on GitHub ↗

getActionlintDocsURL returns the documentation URL for a given actionlint error kind Error kinds map to documentation anchors at https://github.com/rhysd/actionlint/blob/main/docs/checks.md

(kind string)

Source from the content-addressed store, hash-verified

49// getActionlintDocsURL returns the documentation URL for a given actionlint error kind
50// Error kinds map to documentation anchors at https://github.com/rhysd/actionlint/blob/main/docs/checks.md
51func getActionlintDocsURL(kind string) string {
52 if kind == "" {
53 return "https://github.com/rhysd/actionlint/blob/main/docs/checks.md"
54 }
55
56 // Map error kind to documentation anchor
57 // Most kinds follow the pattern "check-{kind}" as the anchor
58 anchor := kind
59
60 // Special case mappings for kinds that don't follow the standard pattern
61 switch kind {
62 case "runner-label":
63 anchor = "check-runner-labels"
64 case "pyflakes":
65 anchor = "check-pyflakes-integ"
66 case "shellcheck":
67 anchor = "check-shellcheck-integ"
68 case "expression":
69 anchor = "check-syntax-expression"
70 case "syntax-check":
71 anchor = "check-unexpected-keys"
72 default:
73 // For other kinds, try the standard "check-{kind}" pattern
74 if !strings.HasPrefix(anchor, "check-") {
75 anchor = "check-" + anchor
76 }
77 }
78
79 return "https://github.com/rhysd/actionlint/blob/main/docs/checks.md#" + anchor
80}
81
82// actionlintStats tracks aggregate statistics across all actionlint validations
83var actionlintStats *ActionlintStats

Callers 2

TestGetActionlintDocsURLFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetActionlintDocsURLFunction · 0.68