Skip to content

Commit

Permalink
use @plugin annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ysugimoto committed Jun 9, 2024
1 parent cf54065 commit 4720c6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/linter/custom_linter.vcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @custom: backend-name
// @plugin: backend-name
backend F_httpbin_org {
.connect_timeout = 1s;
.dynamic = true;
Expand Down
4 changes: 2 additions & 2 deletions linter/custom_linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ func parseCustomLinterCall(meta *ast.Meta) []CustomLinterCall {
for i := range meta.Leading {
l := strings.TrimLeft(meta.Leading[i].Value, " */#")
if strings.HasPrefix(l, "@") {
if !strings.HasPrefix(l, "@custom:") {
if !strings.HasPrefix(l, "@plugin:") {
continue
}
normalized := strings.TrimSpace(strings.TrimPrefix(l, "@custom:"))
normalized := strings.TrimSpace(strings.TrimPrefix(l, "@plugin:"))
parsed := strings.Split(normalized, " ")
call := CustomLinterCall{
name: CustomCommandPrefix + parsed[0],
Expand Down

0 comments on commit 4720c6a

Please sign in to comment.