Skip to content

Commit 27a8ca6

Browse files
committed
tests: add sample
1 parent be17f48 commit 27a8ca6

File tree

5 files changed

+58
-0
lines changed

5 files changed

+58
-0
lines changed

sample-plugins/.custom-gcl.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.6.1
2+
name: custom-golangci-lint
3+
#destination: ./zzz/path/
4+
5+
plugins:
6+
- module: 'github.com/golangci/example-plugin-module-linter'
7+
version: v0.1.0

sample-plugins/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/custom-golangci-lint

sample-plugins/.golangci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "2"
2+
3+
linters:
4+
default: none
5+
enable:
6+
- example
7+
8+
settings:
9+
custom:
10+
example:
11+
type: module
12+
# Description is optional
13+
description: The description of the linter. This is optional, but shows up when running `golangci-lint linters`.
14+
# Original-url is optional, and is only used for documentation purposes.
15+
original-url: github.com/golangci/example-plugin-module-linter
16+
settings:
17+
one: Foo
18+
two:
19+
- name: Bar
20+
three:
21+
name: Bar
22+
23+
issues:
24+
max-issues-per-linter: 0
25+
max-same-issues: 0

sample-plugins/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/golangci/sample
2+
3+
go 1.24.0

sample-plugins/sample.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Package sample is used as test input for golangci action.
2+
package sample
3+
4+
// comment without a to do
5+
func SomeFunc1() {
6+
_ = 1 + 1
7+
}
8+
9+
// TODO: do something // want "TODO comment has no author"
10+
func SomeFunc2() {
11+
_ = 1 + 2
12+
}
13+
14+
// TODO(): do something // want "TODO comment has no author"
15+
func SomeFunc3() {
16+
_ = 1 + 3
17+
}
18+
19+
// TODO(dbraley): Do something with the value
20+
func SomeFunc4() {
21+
_ = 1 + 4
22+
}

0 commit comments

Comments
 (0)