mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 08:55:27 +03:00
Fix failing linters (#2281)
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com> Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
This commit is contained in:
parent
7c2493460f
commit
a6983edf6e
@ -18,7 +18,6 @@ linters:
|
|||||||
disable-all: true
|
disable-all: true
|
||||||
enable:
|
enable:
|
||||||
- asciicheck
|
- asciicheck
|
||||||
- bodyclose
|
|
||||||
- deadcode
|
- deadcode
|
||||||
- depguard
|
- depguard
|
||||||
- dogsled
|
- dogsled
|
||||||
@ -50,17 +49,13 @@ linters:
|
|||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- nestif
|
- nestif
|
||||||
- noctx
|
|
||||||
- nolintlint
|
|
||||||
- paralleltest
|
- paralleltest
|
||||||
- predeclared
|
- predeclared
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- stylecheck
|
- stylecheck
|
||||||
- thelper
|
- thelper
|
||||||
- tparallel
|
|
||||||
- typecheck
|
- typecheck
|
||||||
- unconvert
|
- unconvert
|
||||||
- unparam
|
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
- varcheck
|
||||||
- whitespace
|
- whitespace
|
||||||
|
@ -64,6 +64,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// CheckResult captures result from a check run.
|
// CheckResult captures result from a check run.
|
||||||
|
//
|
||||||
//nolint:govet
|
//nolint:govet
|
||||||
type CheckResult struct {
|
type CheckResult struct {
|
||||||
Name string
|
Name string
|
||||||
@ -94,6 +95,7 @@ type CheckDetail struct {
|
|||||||
|
|
||||||
// LogMessage is a structure that encapsulates detail's information.
|
// LogMessage is a structure that encapsulates detail's information.
|
||||||
// This allows updating the definition easily.
|
// This allows updating the definition easily.
|
||||||
|
//
|
||||||
//nolint:govet
|
//nolint:govet
|
||||||
type LogMessage struct {
|
type LogMessage struct {
|
||||||
Text string // A short string explaining why the detail was recorded/logged.
|
Text string // A short string explaining why the detail was recorded/logged.
|
||||||
|
@ -535,6 +535,7 @@ func TestOnMatchingFileContent(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TestOnAllFilesDo tests the OnAllFilesDo function.
|
// TestOnAllFilesDo tests the OnAllFilesDo function.
|
||||||
|
//
|
||||||
//nolint:gocognit
|
//nolint:gocognit
|
||||||
func TestOnAllFilesDo(t *testing.T) {
|
func TestOnAllFilesDo(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
@ -33,7 +33,7 @@ var (
|
|||||||
mainBranchName = "main"
|
mainBranchName = "main"
|
||||||
)
|
)
|
||||||
|
|
||||||
//nolint: govet
|
// nolint: govet
|
||||||
type branchArg struct {
|
type branchArg struct {
|
||||||
err error
|
err error
|
||||||
name string
|
name string
|
||||||
|
@ -103,6 +103,7 @@ func TestLicenseFileCheck(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: paralleltest
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
tt := tt // Re-initializing variable so it is not changed while executing the closure below
|
tt := tt // Re-initializing variable so it is not changed while executing the closure below
|
||||||
for _, ext := range tt.extensions {
|
for _, ext := range tt.extensions {
|
||||||
|
@ -890,7 +890,7 @@ func validateShellFileAndRecord(pathfn string, startLine, endLine uint, content
|
|||||||
// TODO: support other interpreters.
|
// TODO: support other interpreters.
|
||||||
// Example: https://github.com/apache/airflow/blob/main/scripts/ci/kubernetes/ci_run_kubernetes_tests.sh#L75
|
// Example: https://github.com/apache/airflow/blob/main/scripts/ci/kubernetes/ci_run_kubernetes_tests.sh#L75
|
||||||
// HOST_PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")')``
|
// HOST_PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")')``
|
||||||
// nolinter
|
// nolint
|
||||||
if ok && isShellInterpreterOrCommand([]string{i}) {
|
if ok && isShellInterpreterOrCommand([]string{i}) {
|
||||||
start, end := getLine(startLine, endLine, node)
|
start, end := getLine(startLine, endLine, node)
|
||||||
e := validateShellFileAndRecord(pathfn, start, end,
|
e := validateShellFileAndRecord(pathfn, start, end,
|
||||||
|
@ -322,7 +322,7 @@ func parseCheckRuns(data *checkRunsGraphqlData) checkRunCache {
|
|||||||
return checkCache
|
return checkCache
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint:all
|
//nolint
|
||||||
func commitsFrom(data *graphqlData, repoOwner, repoName string) ([]clients.Commit, error) {
|
func commitsFrom(data *graphqlData, repoOwner, repoName string) ([]clients.Commit, error) {
|
||||||
ret := make([]clients.Commit, 0)
|
ret := make([]clients.Commit, 0)
|
||||||
for _, commit := range data.Repository.Object.Commit.History.Nodes {
|
for _, commit := range data.Repository.Object.Commit.History.Nodes {
|
||||||
|
@ -42,6 +42,7 @@ func main() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: gosec // internal server.
|
||||||
if err := http.Serve(l, nil); err != nil {
|
if err := http.Serve(l, nil); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ func (handler *tarballHandler) getTarball() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: gocognit
|
// nolint: gocognit
|
||||||
func (handler *tarballHandler) extractTarball() error {
|
func (handler *tarballHandler) extractTarball() error {
|
||||||
in, err := os.OpenFile(handler.tempTarFile, os.O_RDONLY, 0o644)
|
in, err := os.OpenFile(handler.tempTarFile, os.O_RDONLY, 0o644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -71,7 +71,7 @@ func setup(inputFile string) (tarballHandler, error) {
|
|||||||
return tarballHandler, nil
|
return tarballHandler, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: gocognit
|
// nolint: gocognit
|
||||||
func TestExtractTarball(t *testing.T) {
|
func TestExtractTarball(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
testcases := []struct {
|
testcases := []struct {
|
||||||
|
@ -18,7 +18,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ func Test_fetchGitRepositoryFromNPM(t *testing.T) {
|
|||||||
|
|
||||||
return &http.Response{
|
return &http.Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: ioutil.NopCloser(bytes.NewBufferString(tt.args.result)),
|
Body: io.NopCloser(bytes.NewBufferString(tt.args.result)),
|
||||||
}, nil
|
}, nil
|
||||||
}).AnyTimes()
|
}).AnyTimes()
|
||||||
got, err := fetchGitRepositoryFromNPM(tt.args.packageName, p)
|
got, err := fetchGitRepositoryFromNPM(tt.args.packageName, p)
|
||||||
@ -423,7 +423,7 @@ func Test_fetchGitRepositoryFromPYPI(t *testing.T) {
|
|||||||
|
|
||||||
return &http.Response{
|
return &http.Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: ioutil.NopCloser(bytes.NewBufferString(tt.args.result)),
|
Body: io.NopCloser(bytes.NewBufferString(tt.args.result)),
|
||||||
}, nil
|
}, nil
|
||||||
}).AnyTimes()
|
}).AnyTimes()
|
||||||
got, err := fetchGitRepositoryFromPYPI(tt.args.packageName, p)
|
got, err := fetchGitRepositoryFromPYPI(tt.args.packageName, p)
|
||||||
@ -692,7 +692,7 @@ func Test_fetchGitRepositoryFromRubyGems(t *testing.T) {
|
|||||||
|
|
||||||
return &http.Response{
|
return &http.Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: ioutil.NopCloser(bytes.NewBufferString(tt.args.result)),
|
Body: io.NopCloser(bytes.NewBufferString(tt.args.result)),
|
||||||
}, nil
|
}, nil
|
||||||
}).AnyTimes()
|
}).AnyTimes()
|
||||||
got, err := fetchGitRepositoryFromRubyGems(tt.args.packageName, p)
|
got, err := fetchGitRepositoryFromRubyGems(tt.args.packageName, p)
|
||||||
|
@ -26,7 +26,7 @@ type packageManagerClient interface {
|
|||||||
|
|
||||||
type packageManager struct{}
|
type packageManager struct{}
|
||||||
|
|
||||||
//nolint: noctx
|
// nolint: noctx
|
||||||
func (c *packageManager) Get(url, packageName string) (*http.Response, error) {
|
func (c *packageManager) Get(url, packageName string) (*http.Response, error) {
|
||||||
const timeout = 10
|
const timeout = 10
|
||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
|
@ -95,6 +95,7 @@ func serveCmd(o *options.Options) *cobra.Command {
|
|||||||
port = "8080"
|
port = "8080"
|
||||||
}
|
}
|
||||||
fmt.Printf("Listening on localhost:%s\n", port)
|
fmt.Printf("Listening on localhost:%s\n", port)
|
||||||
|
//nolint: gosec // unsused.
|
||||||
err = http.ListenAndServe(fmt.Sprintf("0.0.0.0:%s", port), nil)
|
err = http.ListenAndServe(fmt.Sprintf("0.0.0.0:%s", port), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO(log): Should this actually panic?
|
// TODO(log): Should this actually panic?
|
||||||
|
@ -24,7 +24,8 @@ import (
|
|||||||
|
|
||||||
// Adds "project=${PROJECT},dependency=true" to the repositories metadata.
|
// Adds "project=${PROJECT},dependency=true" to the repositories metadata.
|
||||||
// Args:
|
// Args:
|
||||||
// file path to old_projects.csv new_projects.csv
|
//
|
||||||
|
// file path to old_projects.csv new_projects.csv
|
||||||
func main() {
|
func main() {
|
||||||
if len(os.Args) != 3 {
|
if len(os.Args) != 3 {
|
||||||
panic("must provide 2 arguments")
|
panic("must provide 2 arguments")
|
||||||
|
@ -81,6 +81,7 @@ func scriptHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/", scriptHandler)
|
http.HandleFunc("/", scriptHandler)
|
||||||
fmt.Printf("Starting HTTP server on port 8080 ...\n")
|
fmt.Printf("Starting HTTP server on port 8080 ...\n")
|
||||||
|
// nolint:gosec // internal server.
|
||||||
if err := http.ListenAndServe(":8080", nil); err != nil {
|
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ const (
|
|||||||
|
|
||||||
var ignoreRuntimeErrors = flag.Bool("ignoreRuntimeErrors", false, "if set to true any runtime errors will be ignored")
|
var ignoreRuntimeErrors = flag.Bool("ignoreRuntimeErrors", false, "if set to true any runtime errors will be ignored")
|
||||||
|
|
||||||
//nolint: gocognit
|
// nolint: gocognit
|
||||||
func processRequest(ctx context.Context,
|
func processRequest(ctx context.Context,
|
||||||
batchRequest *data.ScorecardBatchRequest,
|
batchRequest *data.ScorecardBatchRequest,
|
||||||
blacklistedChecks []string, bucketURL, rawBucketURL, apiBucketURL string,
|
blacklistedChecks []string, bucketURL, rawBucketURL, apiBucketURL string,
|
||||||
@ -267,6 +267,7 @@ func main() {
|
|||||||
// Exposed for monitoring runtime profiles
|
// Exposed for monitoring runtime profiles
|
||||||
go func() {
|
go func() {
|
||||||
// TODO(log): Previously Fatal. Need to handle the error here.
|
// TODO(log): Previously Fatal. Need to handle the error here.
|
||||||
|
//nolint: gosec // internal server.
|
||||||
logger.Info(fmt.Sprintf("%v", http.ListenAndServe(":8080", nil)))
|
logger.Info(fmt.Sprintf("%v", http.ListenAndServe(":8080", nil)))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
var checksYAML []byte
|
var checksYAML []byte
|
||||||
|
|
||||||
// Check stores a check's information.
|
// Check stores a check's information.
|
||||||
|
//
|
||||||
//nolint:govet
|
//nolint:govet
|
||||||
type Check struct {
|
type Check struct {
|
||||||
Risk string `yaml:"risk"`
|
Risk string `yaml:"risk"`
|
||||||
|
@ -16,7 +16,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -173,7 +172,7 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() {
|
|||||||
})
|
})
|
||||||
It("Should return binary artifacts present at commit in source code when using local repoClient", func() {
|
It("Should return binary artifacts present at commit in source code when using local repoClient", func() {
|
||||||
// create temp dir
|
// create temp dir
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := os.MkdirTemp("", "")
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@ -15,7 +15,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -83,7 +82,7 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
|
|||||||
It("Should return dangerous workflow for local repoClient", func() {
|
It("Should return dangerous workflow for local repoClient", func() {
|
||||||
dl := scut.TestDetailLogger{}
|
dl := scut.TestDetailLogger{}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := os.MkdirTemp("", "")
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@ -15,7 +15,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -85,7 +84,7 @@ var _ = Describe("E2E TEST:"+checks.CheckLicense, func() {
|
|||||||
It("Should return license check works for the local repoclient", func() {
|
It("Should return license check works for the local repoclient", func() {
|
||||||
dl := scut.TestDetailLogger{}
|
dl := scut.TestDetailLogger{}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := os.MkdirTemp("", "")
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -85,7 +84,7 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
|
|||||||
It("Should return token permission for a local repo client", func() {
|
It("Should return token permission for a local repo client", func() {
|
||||||
dl := scut.TestDetailLogger{}
|
dl := scut.TestDetailLogger{}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := os.MkdirTemp("", "")
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@ -15,7 +15,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -87,7 +86,7 @@ var _ = Describe("E2E TEST:"+checks.CheckPinnedDependencies, func() {
|
|||||||
It("Should return dependencies check for a local repoClient", func() {
|
It("Should return dependencies check for a local repoClient", func() {
|
||||||
dl := scut.TestDetailLogger{}
|
dl := scut.TestDetailLogger{}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := os.MkdirTemp("", "")
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@ -15,7 +15,6 @@ package e2e
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -139,7 +138,7 @@ var _ = Describe("E2E TEST:"+checks.CheckSecurityPolicy, func() {
|
|||||||
It("Should return valid security policy for local repoClient at head", func() {
|
It("Should return valid security policy for local repoClient at head", func() {
|
||||||
dl := scut.TestDetailLogger{}
|
dl := scut.TestDetailLogger{}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := os.MkdirTemp("", "")
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
"github.com/ossf/scorecard/v4/log"
|
"github.com/ossf/scorecard/v4/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
//nolint
|
// nolint: govet
|
||||||
type jsonCheckResult struct {
|
type jsonCheckResult struct {
|
||||||
Name string
|
Name string
|
||||||
Details []string
|
Details []string
|
||||||
@ -45,7 +45,7 @@ type jsonCheckDocumentationV2 struct {
|
|||||||
// Can be extended if needed.
|
// Can be extended if needed.
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint
|
// nolint: govet
|
||||||
type jsonCheckResultV2 struct {
|
type jsonCheckResultV2 struct {
|
||||||
Details []string `json:"details"`
|
Details []string `json:"details"`
|
||||||
Score int `json:"score"`
|
Score int `json:"score"`
|
||||||
@ -71,8 +71,9 @@ func (s jsonFloatScore) MarshalJSON() ([]byte, error) {
|
|||||||
return []byte(fmt.Sprintf("%.1f", s)), nil
|
return []byte(fmt.Sprintf("%.1f", s)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint:govet
|
|
||||||
// JSONScorecardResultV2 exports results as JSON for new detail format.
|
// JSONScorecardResultV2 exports results as JSON for new detail format.
|
||||||
|
//
|
||||||
|
//nolint:govet
|
||||||
type JSONScorecardResultV2 struct {
|
type JSONScorecardResultV2 struct {
|
||||||
Date string `json:"date"`
|
Date string `json:"date"`
|
||||||
Repo jsonRepoV2 `json:"repo"`
|
Repo jsonRepoV2 `json:"repo"`
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -99,7 +99,7 @@ func errCmp(e1, e2 error) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ValidateTestReturn validates expected TestReturn with actual checker.CheckResult values.
|
// ValidateTestReturn validates expected TestReturn with actual checker.CheckResult values.
|
||||||
//nolint: thelper
|
// nolint: thelper
|
||||||
func ValidateTestReturn(
|
func ValidateTestReturn(
|
||||||
t *testing.T,
|
t *testing.T,
|
||||||
name string,
|
name string,
|
||||||
|
Loading…
Reference in New Issue
Block a user