aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/maratori
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-01-22 16:07:17 +0100
committerTaras Madan <tarasmadan@google.com>2025-01-23 10:42:36 +0000
commit7b4377ad9d8a7205416df8d6217ef2b010f89481 (patch)
treee6fec4fd12ff807a16d847923f501075bf71d16c /vendor/github.com/maratori
parent475a4c203afb8b7d3af51c4fd32bb170ff32a45e (diff)
vendor: delete
Diffstat (limited to 'vendor/github.com/maratori')
-rw-r--r--vendor/github.com/maratori/testableexamples/LICENSE21
-rw-r--r--vendor/github.com/maratori/testableexamples/pkg/testableexamples/testableexamples.go34
-rw-r--r--vendor/github.com/maratori/testpackage/LICENSE21
-rw-r--r--vendor/github.com/maratori/testpackage/pkg/testpackage/testpackage.go73
4 files changed, 0 insertions, 149 deletions
diff --git a/vendor/github.com/maratori/testableexamples/LICENSE b/vendor/github.com/maratori/testableexamples/LICENSE
deleted file mode 100644
index e8b68be3e..000000000
--- a/vendor/github.com/maratori/testableexamples/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2022 Marat Reymers
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/maratori/testableexamples/pkg/testableexamples/testableexamples.go b/vendor/github.com/maratori/testableexamples/pkg/testableexamples/testableexamples.go
deleted file mode 100644
index 26d22c703..000000000
--- a/vendor/github.com/maratori/testableexamples/pkg/testableexamples/testableexamples.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package testableexamples
-
-import (
- "go/ast"
- "go/doc"
- "strings"
-
- "golang.org/x/tools/go/analysis"
-)
-
-// NewAnalyzer returns Analyzer that checks if examples are testable.
-func NewAnalyzer() *analysis.Analyzer {
- return &analysis.Analyzer{
- Name: "testableexamples",
- Doc: "linter checks if examples are testable (have an expected output)",
- Run: func(pass *analysis.Pass) (interface{}, error) {
- testFiles := make([]*ast.File, 0, len(pass.Files))
- for _, file := range pass.Files {
- fileName := pass.Fset.File(file.Pos()).Name()
- if strings.HasSuffix(fileName, "_test.go") {
- testFiles = append(testFiles, file)
- }
- }
-
- for _, example := range doc.Examples(testFiles...) {
- if example.Output == "" && !example.EmptyOutput {
- pass.Reportf(example.Code.Pos(), "missing output for example, go test can't validate it")
- }
- }
-
- return nil, nil
- },
- }
-}
diff --git a/vendor/github.com/maratori/testpackage/LICENSE b/vendor/github.com/maratori/testpackage/LICENSE
deleted file mode 100644
index 644d0b1c8..000000000
--- a/vendor/github.com/maratori/testpackage/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2019 Marat Reymers
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/maratori/testpackage/pkg/testpackage/testpackage.go b/vendor/github.com/maratori/testpackage/pkg/testpackage/testpackage.go
deleted file mode 100644
index 2e0572972..000000000
--- a/vendor/github.com/maratori/testpackage/pkg/testpackage/testpackage.go
+++ /dev/null
@@ -1,73 +0,0 @@
-package testpackage
-
-import (
- "flag"
- "regexp"
- "strings"
-
- "go/ast"
-
- "golang.org/x/tools/go/analysis"
-)
-
-const (
- SkipRegexpFlagName = "skip-regexp"
- SkipRegexpFlagUsage = `regexp pattern to skip file by name. To not skip files use -skip-regexp="^$"`
- SkipRegexpFlagDefault = `(export|internal)_test\.go`
-)
-
-const (
- AllowPackagesFlagName = "allow-packages"
- AllowPackagesFlagUsage = `comma separated list of packages that don't end with _test that tests are allowed to be in`
- AllowPackagesFlagDefault = `main`
-)
-
-func processTestFile(pass *analysis.Pass, f *ast.File, allowedPackages []string) {
- packageName := f.Name.Name
-
- for _, p := range allowedPackages {
- if p == packageName {
- return
- }
- }
-
- if !strings.HasSuffix(packageName, "_test") {
- pass.Reportf(f.Name.Pos(), "package should be `%s_test` instead of `%s`", packageName, packageName)
- }
-}
-
-// NewAnalyzer returns Analyzer that makes you use a separate _test package.
-func NewAnalyzer() *analysis.Analyzer {
- var (
- skipFileRegexp = SkipRegexpFlagDefault
- allowPackagesStr = AllowPackagesFlagDefault
- fs flag.FlagSet
- )
-
- fs.StringVar(&skipFileRegexp, SkipRegexpFlagName, skipFileRegexp, SkipRegexpFlagUsage)
- fs.StringVar(&allowPackagesStr, AllowPackagesFlagName, allowPackagesStr, AllowPackagesFlagUsage)
-
- return &analysis.Analyzer{
- Name: "testpackage",
- Doc: "linter that makes you use a separate _test package",
- Flags: fs,
- Run: func(pass *analysis.Pass) (interface{}, error) {
- allowedPackages := strings.Split(allowPackagesStr, ",")
- skipFile, err := regexp.Compile(skipFileRegexp)
- if err != nil {
- return nil, err
- }
-
- for _, f := range pass.Files {
- fileName := pass.Fset.Position(f.Pos()).Filename
- if !strings.HasSuffix(fileName, "_test.go") || skipFile.MatchString(fileName) {
- continue
- }
-
- processTestFile(pass, f, allowedPackages)
- }
-
- return nil, nil
- },
- }
-}