mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Merge pull request #238 from sauyon/semmle-to-github
Rename the go module to github.com/github/codeql-go
This commit is contained in:
@@ -94,7 +94,7 @@ func getImportPath() (importpath string) {
|
||||
}
|
||||
|
||||
func getImportPathFromRepoURL(repourl string) string {
|
||||
// check for scp-like URL as in "git@github.com:Semmle/go.git"
|
||||
// check for scp-like URL as in "git@github.com:github/codeql-go.git"
|
||||
shorturl := regexp.MustCompile("^([^@]+@)?([^:]+):([^/].*?)(\\.git)?$")
|
||||
m := shorturl.FindStringSubmatch(repourl)
|
||||
if m != nil {
|
||||
|
||||
@@ -4,11 +4,11 @@ import "testing"
|
||||
|
||||
func TestGetImportPathFromRepoURL(t *testing.T) {
|
||||
tests := map[string]string{
|
||||
"git@github.com:Semmle/go.git": "github.com/Semmle/go",
|
||||
"git@github.com:Semmle/go": "github.com/Semmle/go",
|
||||
"https://github.com/Semmle/go.git": "github.com/Semmle/go",
|
||||
"https://github.com:12345/Semmle/go": "github.com/Semmle/go",
|
||||
"gitolite@some.url:some/repo": "some.url/some/repo",
|
||||
"git@github.com:github/codeql-go.git": "github.com/github/codeql-go",
|
||||
"git@github.com:github/codeql-go": "github.com/github/codeql-go",
|
||||
"https://github.com/github/codeql-go.git": "github.com/github/codeql-go",
|
||||
"https://github.com:12345/github/codeql-go": "github.com/github/codeql-go",
|
||||
"gitolite@some.url:some/repo": "some.url/some/repo",
|
||||
}
|
||||
for input, expected := range tests {
|
||||
actual := getImportPathFromRepoURL(input)
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/Semmle/go/extractor/dbscheme"
|
||||
"github.com/github/codeql-go/extractor/dbscheme"
|
||||
|
||||
"github.com/Semmle/go/extractor"
|
||||
"github.com/github/codeql-go/extractor"
|
||||
)
|
||||
|
||||
func usage() {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/Semmle/go/extractor/trap"
|
||||
"github.com/github/codeql-go/extractor/trap"
|
||||
)
|
||||
|
||||
// A Type represents a database type
|
||||
|
||||
@@ -17,9 +17,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Semmle/go/extractor/dbscheme"
|
||||
"github.com/Semmle/go/extractor/srcarchive"
|
||||
"github.com/Semmle/go/extractor/trap"
|
||||
"github.com/github/codeql-go/extractor/dbscheme"
|
||||
"github.com/github/codeql-go/extractor/srcarchive"
|
||||
"github.com/github/codeql-go/extractor/trap"
|
||||
"golang.org/x/tools/go/packages"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Semmle/go/extractor/srcarchive"
|
||||
"github.com/github/codeql-go/extractor/srcarchive"
|
||||
"golang.org/x/tools/go/packages"
|
||||
)
|
||||
|
||||
|
||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
||||
module github.com/Semmle/go
|
||||
module github.com/github/codeql-go
|
||||
|
||||
go 1.13
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
| iHaveAMethod | meth | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes | iHaveAMethod | meth |
|
||||
| pointer type | meth | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes | iHaveAMethod | meth |
|
||||
| pointer type | meth1 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth1 |
|
||||
| starImpl | meth2 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth2 |
|
||||
| twoMethods | meth1 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth1 |
|
||||
| twoMethods | meth2 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth2 |
|
||||
| iHaveAMethod | meth | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes | iHaveAMethod | meth |
|
||||
| pointer type | meth | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes | iHaveAMethod | meth |
|
||||
| pointer type | meth1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth1 |
|
||||
| starImpl | meth2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth2 |
|
||||
| twoMethods | meth1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth1 |
|
||||
| twoMethods | meth2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes | twoMethods | meth2 |
|
||||
|
||||
@@ -3,5 +3,5 @@ import go
|
||||
from Method m, string pkg, string tp, string name
|
||||
where
|
||||
m.implements(pkg, tp, name) and
|
||||
m.hasQualifiedName("github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes", _, _)
|
||||
m.hasQualifiedName("github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes", _, _)
|
||||
select m.getReceiverType(), m.getName(), pkg, tp, name
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
| main.go:13:16:13:19 | meth | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.t.meth | main.go:13:7:13:10 | recv | * t |
|
||||
| main.go:23:16:23:19 | bump | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.t.bump | main.go:23:7:23:10 | recv | * t |
|
||||
| types.go:4:2:4:5 | meth | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.iHaveAMethod.meth | file://:0:0:0:0 | | iHaveAMethod |
|
||||
| types.go:8:2:8:6 | meth1 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.twoMethods.meth1 | file://:0:0:0:0 | | twoMethods |
|
||||
| types.go:9:2:9:6 | meth2 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.twoMethods.meth2 | file://:0:0:0:0 | | twoMethods |
|
||||
| types.go:14:18:14:22 | meth1 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.starImpl.meth1 | file://:0:0:0:0 | | * starImpl |
|
||||
| types.go:18:17:18:21 | meth2 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.starImpl.meth2 | file://:0:0:0:0 | | starImpl |
|
||||
| types.go:24:16:24:20 | meth1 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.notImpl.meth1 | file://:0:0:0:0 | | notImpl |
|
||||
| types.go:28:16:28:20 | meth2 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes.notImpl.meth2 | file://:0:0:0:0 | | notImpl |
|
||||
| main.go:13:16:13:19 | meth | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.t.meth | main.go:13:7:13:10 | recv | * t |
|
||||
| main.go:23:16:23:19 | bump | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.t.bump | main.go:23:7:23:10 | recv | * t |
|
||||
| types.go:4:2:4:5 | meth | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.iHaveAMethod.meth | file://:0:0:0:0 | | iHaveAMethod |
|
||||
| types.go:8:2:8:6 | meth1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.twoMethods.meth1 | file://:0:0:0:0 | | twoMethods |
|
||||
| types.go:9:2:9:6 | meth2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.twoMethods.meth2 | file://:0:0:0:0 | | twoMethods |
|
||||
| types.go:14:18:14:22 | meth1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.starImpl.meth1 | file://:0:0:0:0 | | * starImpl |
|
||||
| types.go:18:17:18:21 | meth2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.starImpl.meth2 | file://:0:0:0:0 | | starImpl |
|
||||
| types.go:24:16:24:20 | meth1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.notImpl.meth1 | file://:0:0:0:0 | | notImpl |
|
||||
| types.go:28:16:28:20 | meth2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes.notImpl.meth2 | file://:0:0:0:0 | | notImpl |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import go
|
||||
|
||||
from Type t, string iface
|
||||
where t.implements("github.com/Semmle/go/ql/test/library-tests/semmle/go/Scopes", iface)
|
||||
where t.implements("github.com/github/codeql-go/ql/test/library-tests/semmle/go/Scopes", iface)
|
||||
select t.pp(), iface
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
| Bar | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg1.Bar |
|
||||
| Foo | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg1.Foo |
|
||||
| G | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg2.G |
|
||||
| T | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg1.T |
|
||||
| T | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg2.T |
|
||||
| T2 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg1.T2 |
|
||||
| T3 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg1.T3 |
|
||||
| T4 | github.com/Semmle/go/ql/test/library-tests/semmle/go/Types/pkg1.T4 |
|
||||
| Bar | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1.Bar |
|
||||
| Foo | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1.Foo |
|
||||
| G | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg2.G |
|
||||
| T | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1.T |
|
||||
| T | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg2.T |
|
||||
| T2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1.T2 |
|
||||
| T3 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1.T3 |
|
||||
| T4 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1.T4 |
|
||||
|
||||
Reference in New Issue
Block a user