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

checkers/commentFormatting: exclude GoLand and VSCode custom folding regions #1408

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions checkers/commentFormatting_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ func init() {
"//nolint",
}
parts := []string{
"//go:generate ", // e.g.: go:generate value
"//line /", // e.g.: line /path/to/file:123
"//nolint ", // e.g.: nolint
"//noinspection ", // e.g.: noinspection ALL, some GoLand and friends versions
"//export ", // e.g.: export Foo
"///", // e.g.: vertical breaker /////////////
"//go:generate ", // e.g.: go:generate value
"//line /", // e.g.: line /path/to/file:123
"//nolint ", // e.g.: nolint
"//noinspection ", // e.g.: noinspection ALL, some GoLand and friends versions
"//region", // e.g.: region awawa, used by GoLand and friends for custom folding
cristaloleg marked this conversation as resolved.
Show resolved Hide resolved
"//endregion", // e.g.: endregion awawa or endregion, closes GoLand regions
"//<editor-fold", // e.g.: <editor-fold desc="awawa"> or <editor-fold>, used by VSCode for custom folding
"//</editor-fold>", // e.g.: </editor-fold>, closes VSCode regions
"//export ", // e.g.: export Foo
"///", // e.g.: vertical breaker /////////////
"//+",
"//#",
"//-",
Expand Down
10 changes: 10 additions & 0 deletions checkers/testdata/commentFormatting/negative_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ func f2() {

// Comment in a comment is //OK
// path */*//with asterisk

//region GoLand custom folding region
func goland() {
}
//endregion

//<editor-fold desc="VSCode custom folding region">
func vscode() {
}
//</editor-fold>