Restructure to focus on lib rather than cli

This commit is contained in:
Grant Murphy 2017-04-26 08:08:46 -07:00
parent 8df48f9769
commit cacf21f3c0
48 changed files with 52 additions and 49 deletions

View file

@ -13,7 +13,7 @@
// limitations under the License.
// Package core holds the central scanning logic used by GAS
package core
package gas
import (
"go/ast"

View file

@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package core
package gas
import (
"go/ast"

View file

@ -1,4 +1,4 @@
package core
package gas
import (
"go/ast"

View file

@ -27,7 +27,7 @@ import (
"sort"
"strings"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
"github.com/GoASTScanner/gas/output"
"golang.org/x/tools/go/loader"
)

View file

@ -17,7 +17,7 @@ package main
import (
"go/ast"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
"github.com/GoASTScanner/gas/rules"
)

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package core
package gas
import (
"fmt"

View file

@ -1,4 +1,4 @@
package core
package gas
import (
"go/ast"

View file

@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package core
package gas
import (
"encoding/json"

View file

@ -22,7 +22,7 @@ import (
"strconv"
plainTemplate "text/template"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
// The output format for reported issues

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package core
package gas
import "go/ast"

View file

@ -15,7 +15,7 @@
package rules
import (
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
"go/ast"
)

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestBigExp(t *testing.T) {

View file

@ -18,7 +18,7 @@ import (
"go/ast"
"regexp"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
// Looks for net.Listen("0.0.0.0") or net.Listen(":8080")

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestBind0000(t *testing.T) {

View file

@ -17,7 +17,7 @@ package rules
import (
"go/ast"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type BlacklistImport struct {

View file

@ -13,8 +13,9 @@
package rules
import (
gas "github.com/GoASTScanner/gas/core"
"testing"
"github.com/GoASTScanner/gas"
)
const initOnlyImportSrc = `

View file

@ -15,9 +15,10 @@
package rules
import (
gas "github.com/GoASTScanner/gas/core"
"go/ast"
"go/types"
"github.com/GoASTScanner/gas"
)
type NoErrorCheck struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestErrorsMulti(t *testing.T) {

View file

@ -19,7 +19,7 @@ import (
"go/ast"
"strconv"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type FilePermissions struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestChmod(t *testing.T) {

View file

@ -15,13 +15,13 @@
package rules
import (
gas "github.com/GoASTScanner/gas/core"
"go/ast"
"go/token"
"regexp"
"github.com/nbutton23/zxcvbn-go"
"strconv"
"github.com/GoASTScanner/gas"
"github.com/nbutton23/zxcvbn-go"
)
type Credentials struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestHardcoded(t *testing.T) {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestHttpoxy(t *testing.T) {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestNosec(t *testing.T) {

View file

@ -17,7 +17,7 @@ package rules
import (
"go/ast"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type WeakRand struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestRandOk(t *testing.T) {

View file

@ -19,7 +19,7 @@ import (
"go/ast"
"regexp"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type WeakKeyStrength struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestRSAKeys(t *testing.T) {

View file

@ -18,7 +18,7 @@ import (
"go/ast"
"regexp"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type SqlStatement struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestSQLInjectionViaConcatenation(t *testing.T) {

View file

@ -19,7 +19,7 @@ import (
"regexp"
"strings"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type Subprocess struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestSubprocess(t *testing.T) {

View file

@ -18,7 +18,7 @@ import (
"go/ast"
"regexp"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type BadTempFile struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestTempfiles(t *testing.T) {

View file

@ -18,7 +18,7 @@ import (
"go/ast"
"regexp"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type TemplateCheck struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestTemplateCheckSafe(t *testing.T) {

View file

@ -20,7 +20,7 @@ import (
"reflect"
"regexp"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type InsecureConfigTLS struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestInsecureSkipVerify(t *testing.T) {

View file

@ -15,8 +15,9 @@
package rules
import (
gas "github.com/GoASTScanner/gas/core"
"go/ast"
"github.com/GoASTScanner/gas"
)
type UsingUnsafe struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestUnsafe(t *testing.T) {

View file

@ -18,7 +18,7 @@ import (
"strings"
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func gasTestRunner(source string, analyzer gas.Analyzer) []*gas.Issue {

View file

@ -17,7 +17,7 @@ package rules
import (
"go/ast"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
type UsesWeakCryptography struct {

View file

@ -17,7 +17,7 @@ package rules
import (
"testing"
gas "github.com/GoASTScanner/gas/core"
"github.com/GoASTScanner/gas"
)
func TestMD5(t *testing.T) {

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package core
package gas
import (
"fmt"