Rename repo/modules.

This commit is contained in:
Dan Lorenc 2020-10-27 14:23:48 -05:00
parent 674ee69ced
commit 9f686dc707
18 changed files with 32 additions and 24 deletions

View File

@ -17,8 +17,8 @@ package checks
import (
"time"
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
var lookbackDays int = 90

View File

@ -14,7 +14,7 @@
package checks
import "github.com/dlorenc/scorecard/checker"
import "github.com/ossf/scorecard/checker"
var AllChecks = []checker.NamedCheck{}

View File

@ -17,8 +17,8 @@ package checks
import (
"strings"
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -19,7 +19,7 @@ import (
"fmt"
"io/ioutil"
"github.com/dlorenc/scorecard/checker"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -15,8 +15,8 @@
package checks
import (
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -17,8 +17,8 @@ package checks
import (
"strings"
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -20,7 +20,7 @@ import (
"io"
"strings"
"github.com/dlorenc/scorecard/checker"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -18,7 +18,7 @@ import (
"fmt"
"strings"
"github.com/dlorenc/scorecard/checker"
"github.com/ossf/scorecard/checker"
)
//go:generate ../gen_github.sh

View File

@ -17,8 +17,8 @@ package checks
import (
"strings"
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -15,8 +15,8 @@
package checks
import (
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -17,8 +17,8 @@ package checks
import (
"path"
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
func init() {

View File

@ -17,8 +17,8 @@ package checks
import (
"strings"
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
var releaseLookBack int = 5

View File

@ -15,8 +15,8 @@
package checks
import (
"github.com/dlorenc/scorecard/checker"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
)
var tagLookBack int = 5

View File

@ -23,9 +23,9 @@ import (
goflag "flag"
"github.com/dlorenc/scorecard/checker"
"github.com/dlorenc/scorecard/checks"
"github.com/dlorenc/scorecard/pkg"
"github.com/ossf/scorecard/checker"
"github.com/ossf/scorecard/checks"
"github.com/ossf/scorecard/pkg"
"github.com/spf13/cobra"
"go.uber.org/zap"
)

View File

@ -18,10 +18,11 @@ import (
"fmt"
"html/template"
"net/http"
"os"
"strings"
"github.com/dlorenc/scorecard/checks"
"github.com/dlorenc/scorecard/pkg"
"github.com/ossf/scorecard/checks"
"github.com/ossf/scorecard/pkg"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
@ -48,6 +49,9 @@ var serveCmd = &cobra.Command{
http.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) {
repoParam := r.URL.Query().Get("repo")
s := strings.SplitN(repoParam, "/", 3)
if len(s) != 3 {
rw.WriteHeader(http.StatusBadRequest)
}
sugar.Info(repoParam)
repo := pkg.RepoURL{
Host: s[0],
@ -67,8 +71,12 @@ var serveCmd = &cobra.Command{
sugar.Warn(err)
}
})
fmt.Println("Listening on localhost:8080")
http.ListenAndServe("localhost:8080", nil)
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
fmt.Printf("Listening on localhost:%s\n", port)
http.ListenAndServe(fmt.Sprintf("0.0.0.0:%s", port), nil)
},
}

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/dlorenc/scorecard
module github.com/ossf/scorecard
go 1.15

View File

@ -14,7 +14,7 @@
package main
import "github.com/dlorenc/scorecard/cmd"
import "github.com/ossf/scorecard/cmd"
func main() {
cmd.Execute()

View File

@ -23,9 +23,9 @@ import (
"strings"
"sync"
"github.com/dlorenc/scorecard/checker"
"github.com/dlorenc/scorecard/roundtripper"
"github.com/google/go-github/v32/github"
"github.com/ossf/scorecard/checker"
"github.com/ossf/scorecard/roundtripper"
"go.uber.org/zap"
)