-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from gcpug/feat-plugin
add plugin for golangci-lint
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This file can build as a plugin for golangci-lint by below command. | ||
// go build -buildmode=plugin -o unclosetx.so github.com/gcpug/zagane/passes/unclosetx/plugin | ||
// See: https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/gcpug/zagane/passes/unclosetx" | ||
"golang.org/x/tools/go/analysis" | ||
) | ||
|
||
// AnalyzerPlugin provides analyzers as a plugin. | ||
// It follows golangci-lint style plugin. | ||
var AnalyzerPlugin analyzerPlugin | ||
|
||
type analyzerPlugin struct{} | ||
|
||
func (analyzerPlugin) GetAnalyzers() []*analysis.Analyzer { | ||
return []*analysis.Analyzer{ | ||
unclosetx.Analyzer, | ||
} | ||
} |
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,22 @@ | ||
// This file can build as a plugin for golangci-lint by below command. | ||
// go build -buildmode=plugin -o unstopiter.so github.com/gcpug/zagane/passes/unstopiter/plugin | ||
// See: https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/gcpug/zagane/passes/unstopiter" | ||
"golang.org/x/tools/go/analysis" | ||
) | ||
|
||
// AnalyzerPlugin provides analyzers as a plugin. | ||
// It follows golangci-lint style plugin. | ||
var AnalyzerPlugin analyzerPlugin | ||
|
||
type analyzerPlugin struct{} | ||
|
||
func (analyzerPlugin) GetAnalyzers() []*analysis.Analyzer { | ||
return []*analysis.Analyzer{ | ||
unstopiter.Analyzer, | ||
} | ||
} |
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,22 @@ | ||
// This file can build as a plugin for golangci-lint by below command. | ||
// go build -buildmode=plugin -o wraperr.so github.com/gcpug/zagane/passes/wraperr/plugin | ||
// See: https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/gcpug/zagane/passes/wraperr" | ||
"golang.org/x/tools/go/analysis" | ||
) | ||
|
||
// AnalyzerPlugin provides analyzers as a plugin. | ||
// It follows golangci-lint style plugin. | ||
var AnalyzerPlugin analyzerPlugin | ||
|
||
type analyzerPlugin struct{} | ||
|
||
func (analyzerPlugin) GetAnalyzers() []*analysis.Analyzer { | ||
return []*analysis.Analyzer{ | ||
wraperr.Analyzer, | ||
} | ||
} |
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,26 @@ | ||
// This file can build as a plugin for golangci-lint by below command. | ||
// go build -buildmode=plugin -o zagane.so github.com/gcpug/zagane/plugin | ||
// See: https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/gcpug/zagane/passes/unclosetx" | ||
"github.com/gcpug/zagane/passes/unstopiter" | ||
"github.com/gcpug/zagane/passes/wraperr" | ||
"golang.org/x/tools/go/analysis" | ||
) | ||
|
||
// AnalyzerPlugin provides analyzers as a plugin. | ||
// It follows golangci-lint style plugin. | ||
var AnalyzerPlugin analyzerPlugin | ||
|
||
type analyzerPlugin struct{} | ||
|
||
func (analyzerPlugin) GetAnalyzers() []*analysis.Analyzer { | ||
return []*analysis.Analyzer{ | ||
unstopiter.Analyzer, | ||
unclosetx.Analyzer, | ||
wraperr.Analyzer, | ||
} | ||
} |