MCPcopy Create free account
hub / github.com/vale-cli/vale / Python

Function Python

internal/lint/code/py.go:10–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8)
9
10func Python() *Language {
11 return &Language{
12 Delims: regexp.MustCompile(`#|"""|'''`),
13 Parser: python.GetLanguage(),
14 Queries: []core.Scope{
15 {Name: "", Expr: `(comment)+ @comment`, Type: ""},
16 // Function docstrings
17 {Name: "", Expr: `((function_definition
18 body: (block . (expression_statement (string) @docstring)))
19 (#offset! @docstring 0 3 0 -3))`, Type: ""},
20 // Class docstrings
21 {Name: "", Expr: `((class_definition
22 body: (block . (expression_statement (string) @docstring)))
23 (#offset! @docstring 0 3 0 -3))`, Type: ""},
24 // Module docstrings
25 {Name: "", Expr: `((module . (expression_statement (string) @docstring))
26 (#offset! @docstring 0 3 0 -3))`, Type: ""},
27 },
28 Padding: func(s string) int {
29 return computePadding(s, []string{"#", `"""`, "'''"})
30 },
31 }
32}

Callers 1

GetLanguageFromExtFunction · 0.85

Calls 1

computePaddingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…