mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-12 14:01:14 +00:00
tests: add sample
This commit is contained in:
parent
be17f48897
commit
27a8ca6470
5 changed files with 58 additions and 0 deletions
7
sample-plugins/.custom-gcl.yml
Normal file
7
sample-plugins/.custom-gcl.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
version: v2.6.1
|
||||
name: custom-golangci-lint
|
||||
#destination: ./zzz/path/
|
||||
|
||||
plugins:
|
||||
- module: 'github.com/golangci/example-plugin-module-linter'
|
||||
version: v0.1.0
|
||||
1
sample-plugins/.gitignore
vendored
Normal file
1
sample-plugins/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/custom-golangci-lint
|
||||
25
sample-plugins/.golangci.yml
Normal file
25
sample-plugins/.golangci.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
version: "2"
|
||||
|
||||
linters:
|
||||
default: none
|
||||
enable:
|
||||
- example
|
||||
|
||||
settings:
|
||||
custom:
|
||||
example:
|
||||
type: module
|
||||
# Description is optional
|
||||
description: The description of the linter. This is optional, but shows up when running `golangci-lint linters`.
|
||||
# Original-url is optional, and is only used for documentation purposes.
|
||||
original-url: github.com/golangci/example-plugin-module-linter
|
||||
settings:
|
||||
one: Foo
|
||||
two:
|
||||
- name: Bar
|
||||
three:
|
||||
name: Bar
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
3
sample-plugins/go.mod
Normal file
3
sample-plugins/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/golangci/sample
|
||||
|
||||
go 1.24.0
|
||||
22
sample-plugins/sample.go
Normal file
22
sample-plugins/sample.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Package sample is used as test input for golangci action.
|
||||
package sample
|
||||
|
||||
// comment without a to do
|
||||
func SomeFunc1() {
|
||||
_ = 1 + 1
|
||||
}
|
||||
|
||||
// TODO: do something // want "TODO comment has no author"
|
||||
func SomeFunc2() {
|
||||
_ = 1 + 2
|
||||
}
|
||||
|
||||
// TODO(): do something // want "TODO comment has no author"
|
||||
func SomeFunc3() {
|
||||
_ = 1 + 3
|
||||
}
|
||||
|
||||
// TODO(dbraley): Do something with the value
|
||||
func SomeFunc4() {
|
||||
_ = 1 + 4
|
||||
}
|
||||
Loading…
Reference in a new issue