generated from reviewdog/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- replace placeholders in action.yml - add sgconfig.yml and teatdata - add to-rdjsonl.jq and fix script.sh Signed-off-by: Rintaro Okamura <[email protected]>
- Loading branch information
Showing
13 changed files
with
157 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ruleDirs: | ||
- ./testdata/rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
) | ||
|
||
func main() { | ||
_ = context.TODO() | ||
|
||
fmt.Println("hello world") | ||
} | ||
|
||
// Deprecated: deprecated function | ||
func New() { | ||
// FIXME: implement me | ||
fmt.Println("new function") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json | ||
|
||
id: avoid-use-deprecated-function | ||
message: Avoid to use deprecated function | ||
severity: warning # error, warning, info, hint | ||
language: Go | ||
rule: | ||
kind: comment | ||
regex: "//\\s*[dD]eprecated:.*" | ||
# utils: Extract repeated rule as local utility here. | ||
# note: Add detailed explanation for the rule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json | ||
|
||
id: no-context-todo | ||
message: Do not use context.TODO in production code | ||
severity: error # error, warning, info, hint | ||
language: Go | ||
rule: | ||
pattern: context.TODO() | ||
# utils: Extract repeated rule as local utility here. | ||
note: context.TODO() is just a temporary thing | ||
fix: context.Background() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json | ||
|
||
id: no-fixme-comment | ||
message: Do not leave fixme comment | ||
severity: info | ||
language: Go | ||
rule: | ||
kind: comment | ||
regex: "//\\s*FIXME:.*" | ||
# utils: Extract repeated rule as local utility here. | ||
# note: Add detailed explanation for the rule. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.[] | | ||
. as $item | | ||
{ | ||
"message": (if .note then (.message + " (Note: " + .note + ")") else .message end), | ||
"severity": .severity | ascii_upcase, | ||
"location": { | ||
"path": .file, | ||
"range": { | ||
"start": { | ||
"line": (.range.start.line + 1), | ||
"column": (.range.start.column + 1) | ||
}, | ||
"end": { | ||
"line": (.range.end.line + 1), | ||
"column": (.range.end.column + 1) | ||
} | ||
} | ||
}, | ||
"code": { | ||
"value": .ruleId, | ||
"url": "https://github.com/ast-grep/ast-grep" | ||
}, | ||
"source": { | ||
"name": "ast-grep", | ||
"url": "https://github.com/ast-grep/ast-grep" | ||
}, | ||
"original_output": . | tostring | ||
} + if .replacement then | ||
{ | ||
"suggestions": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": (.range.start.line + 1), | ||
"column": (.range.start.column + 1) | ||
}, | ||
"end": { | ||
"line": (.range.end.line + 1), | ||
"column": (.range.end.column + 1) | ||
} | ||
}, | ||
"text": .replacement | ||
} | ||
] | ||
} | ||
else {} end |