Switch to gometalinter

Only small amount of required checks is enabled,
plan is to enable more linters as issues are fixed in the code.
This commit is contained in:
Andrey Smirnov
2017-03-23 00:50:49 +03:00
parent 53e59d3765
commit 516dd7b044
80 changed files with 201 additions and 123 deletions
+4 -3
View File
@@ -4,13 +4,14 @@ package cmd
import (
"bytes"
"fmt"
"os"
"text/template"
"time"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
"os"
"text/template"
"time"
)
// ListPackagesRefList shows list of packages in PackageRefList
+1
View File
@@ -3,6 +3,7 @@ package cmd
import (
"encoding/json"
"fmt"
"github.com/smira/commander"
)
+4 -3
View File
@@ -2,11 +2,12 @@ package cmd
import (
"fmt"
"sort"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"sort"
"strings"
)
// aptly db cleanup
@@ -153,7 +154,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
context.Progress().ColoredPrintf("@{w!}Loading list of all packages...@|")
allPackageRefs := context.CollectionFactory().PackageCollection().AllPackageRefs()
toDelete := allPackageRefs.Substract(existingPackageRefs)
toDelete := allPackageRefs.Subtract(existingPackageRefs)
// delete packages that are no longer referenced
context.Progress().ColoredPrintf("@{r!}Deleting unreferenced packages (%d)...@|", toDelete.Len())
+4 -3
View File
@@ -3,14 +3,15 @@ package cmd
import (
"bytes"
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
)
func aptlyGraph(cmd *commander.Command, args []string) error {
+2 -1
View File
@@ -1,10 +1,11 @@
package cmd
import (
"strings"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"strings"
)
func getVerifier(flags *flag.FlagSet) (utils.Verifier, error) {
+2 -1
View File
@@ -2,11 +2,12 @@ package cmd
import (
"fmt"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/query"
"github.com/smira/commander"
"github.com/smira/flag"
"strings"
)
func aptlyMirrorCreate(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/commander"
"github.com/smira/flag"
)
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/query"
"github.com/smira/commander"
"github.com/smira/flag"
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"sort"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
func aptlyMirrorList(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
+2 -1
View File
@@ -2,11 +2,12 @@ package cmd
import (
"fmt"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"strings"
)
func aptlyMirrorShow(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"sort"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
func aptlyPublishList(cmd *commander.Command, args []string) error {
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"strings"
)
func aptlyPublishShow(cmd *commander.Command, args []string) error {
+2 -1
View File
@@ -2,12 +2,13 @@ package cmd
import (
"fmt"
"strings"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"strings"
)
func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
+2 -1
View File
@@ -2,11 +2,12 @@ package cmd
import (
"fmt"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"strings"
)
func aptlyPublishSwitch(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
+2 -1
View File
@@ -2,12 +2,13 @@ package cmd
import (
"fmt"
"os"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"os"
)
func aptlyRepoAdd(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/commander"
"github.com/smira/flag"
)
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/AlekSi/pointer"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
+4 -3
View File
@@ -3,15 +3,16 @@ package cmd
import (
"bytes"
"fmt"
"os"
"path/filepath"
"text/template"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/query"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"os"
"path/filepath"
"text/template"
)
func aptlyRepoInclude(cmd *commander.Command, args []string) error {
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"sort"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
func aptlyRepoList(cmd *commander.Command, args []string) error {
+2 -1
View File
@@ -2,11 +2,12 @@ package cmd
import (
"fmt"
"sort"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/query"
"github.com/smira/commander"
"github.com/smira/flag"
"sort"
)
func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/query"
"github.com/smira/commander"
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/commander"
"github.com/smira/flag"
)
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"os"
ctx "github.com/smira/aptly/context"
"github.com/smira/commander"
"os"
)
// Run runs single command starting from root cmd with args, optionally initializing context
+6 -5
View File
@@ -2,16 +2,17 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
"net"
"net/http"
"os"
"sort"
"strings"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
)
func aptlyServe(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/commander"
"github.com/smira/flag"
)
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/commander"
"github.com/smira/flag"
)
+3 -2
View File
@@ -2,12 +2,13 @@ package cmd
import (
"fmt"
"sort"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/query"
"github.com/smira/commander"
"github.com/smira/flag"
"sort"
"strings"
)
func aptlySnapshotFilter(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"strings"
)
func aptlySnapshotMerge(cmd *commander.Command, args []string) error {
+3 -2
View File
@@ -2,12 +2,13 @@ package cmd
import (
"fmt"
"sort"
"strings"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/query"
"github.com/smira/commander"
"github.com/smira/flag"
"sort"
"strings"
)
func aptlySnapshotPull(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/commander"
"github.com/smira/flag"
)
+2 -1
View File
@@ -2,9 +2,10 @@ package cmd
import (
"fmt"
"sort"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
+1
View File
@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/aptly"
"github.com/smira/commander"
)