Add linter for import groups and group order (#477)
* Add import order linter Error messages aren't the most clear/helpful, but they will point you to the lines that need modifying. * Adjust max errors reported * Fix lint errors
This commit is contained in:
parent
bb7531d95c
commit
d920589507
@ -5,3 +5,16 @@ linters:
|
||||
enable:
|
||||
- gofmt
|
||||
- misspell
|
||||
- gci
|
||||
|
||||
linters-settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard
|
||||
- default
|
||||
- prefix(github.com/alcionai/corso)
|
||||
skip-generated: true
|
||||
|
||||
issues:
|
||||
# Limit on number of errors with identical text reported.
|
||||
max-same-issues: 50
|
||||
|
||||
@ -3,11 +3,12 @@ package config
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/alcionai/corso/cli/utils"
|
||||
"github.com/alcionai/corso/pkg/account"
|
||||
"github.com/alcionai/corso/pkg/credentials"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// prerequisite: readRepoConfig must have been run prior to this to populate the global viper values.
|
||||
|
||||
@ -3,11 +3,12 @@ package config
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/alcionai/corso/cli/utils"
|
||||
"github.com/alcionai/corso/pkg/credentials"
|
||||
"github.com/alcionai/corso/pkg/storage"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// prerequisite: readRepoConfig must have been run prior to this to populate the global viper values.
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
package options
|
||||
|
||||
import (
|
||||
"github.com/alcionai/corso/pkg/control"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/alcionai/corso/pkg/control"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -5,11 +5,12 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/alcionai/corso/pkg/backup"
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/tidwall/pretty"
|
||||
"github.com/tomlazar/table"
|
||||
|
||||
"github.com/alcionai/corso/pkg/backup"
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -3,8 +3,9 @@ package exchange
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
)
|
||||
|
||||
func MessageInfo(msg models.Messageable) *details.ExchangeInfo {
|
||||
|
||||
@ -4,9 +4,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
)
|
||||
|
||||
type MessageSuite struct {
|
||||
|
||||
@ -5,9 +5,8 @@ import (
|
||||
"strconv"
|
||||
|
||||
kw "github.com/microsoft/kiota-serialization-json-go"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/microsoftgraph/msgraph-sdk-go/models"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var eventResponsableFields = []string{"responseType"}
|
||||
|
||||
@ -3,9 +3,10 @@ package model_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/alcionai/corso/internal/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/internal/model"
|
||||
)
|
||||
|
||||
type ModelUnitSuite struct {
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package tester
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/alcionai/corso/pkg/account"
|
||||
"github.com/alcionai/corso/pkg/credentials"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var M365AcctCredEnvs = []string{
|
||||
|
||||
@ -5,9 +5,10 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/alcionai/corso/pkg/account"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/alcionai/corso/pkg/account"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -3,9 +3,10 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/alcionai/corso/pkg/credentials"
|
||||
"github.com/alcionai/corso/pkg/storage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var AWSStorageCredEnvs = []string{
|
||||
|
||||
@ -3,9 +3,10 @@ package filters_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/alcionai/corso/pkg/filters"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/pkg/filters"
|
||||
)
|
||||
|
||||
type FiltersSuite struct {
|
||||
|
||||
@ -4,11 +4,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/corso/internal/common"
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/internal/common"
|
||||
"github.com/alcionai/corso/pkg/backup/details"
|
||||
)
|
||||
|
||||
type ExchangeSourceSuite struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user