Add make fmt for src (#2436)
## Description Adds make command for code formatting. ## Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [x] 🧹 Tech Debt/Cleanup
This commit is contained in:
parent
667d2d8e29
commit
81ecb072ff
@ -15,6 +15,10 @@ lint: check-lint-version
|
|||||||
golangci-lint run
|
golangci-lint run
|
||||||
staticcheck ./...
|
staticcheck ./...
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
gofumpt -w .
|
||||||
|
gci write --skip-generated -s 'standard,default,prefix(github.com/alcionai/corso)' .
|
||||||
|
|
||||||
check-lint-version: check-lint
|
check-lint-version: check-lint
|
||||||
@if [ "$(LINT_VERSION)" != "$(WANTED_LINT_VERSION)" ]; then \
|
@if [ "$(LINT_VERSION)" != "$(WANTED_LINT_VERSION)" ]; then \
|
||||||
echo >&2 $(BAD_LINT_MSG); \
|
echo >&2 $(BAD_LINT_MSG); \
|
||||||
|
|||||||
@ -21,6 +21,7 @@ const (
|
|||||||
func (i HorizontalSectionLayoutType) String() string {
|
func (i HorizontalSectionLayoutType) String() string {
|
||||||
return []string{"none", "oneColumn", "twoColumns", "threeColumns", "oneThirdLeftColumn", "oneThirdRightColumn", "fullWidth", "unknownFutureValue"}[i]
|
return []string{"none", "oneColumn", "twoColumns", "threeColumns", "oneThirdLeftColumn", "oneThirdRightColumn", "fullWidth", "unknownFutureValue"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseHorizontalSectionLayoutType(v string) (interface{}, error) {
|
func ParseHorizontalSectionLayoutType(v string) (interface{}, error) {
|
||||||
result := NONE_HORIZONTALSECTIONLAYOUTTYPE
|
result := NONE_HORIZONTALSECTIONLAYOUTTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -45,6 +46,7 @@ func ParseHorizontalSectionLayoutType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializeHorizontalSectionLayoutType(values []HorizontalSectionLayoutType) []string {
|
func SerializeHorizontalSectionLayoutType(values []HorizontalSectionLayoutType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ const (
|
|||||||
func (i PageLayoutType) String() string {
|
func (i PageLayoutType) String() string {
|
||||||
return []string{"microsoftReserved", "article", "home", "unknownFutureValue"}[i]
|
return []string{"microsoftReserved", "article", "home", "unknownFutureValue"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParsePageLayoutType(v string) (interface{}, error) {
|
func ParsePageLayoutType(v string) (interface{}, error) {
|
||||||
result := MICROSOFTRESERVED_PAGELAYOUTTYPE
|
result := MICROSOFTRESERVED_PAGELAYOUTTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -33,6 +34,7 @@ func ParsePageLayoutType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializePageLayoutType(values []PageLayoutType) []string {
|
func SerializePageLayoutType(values []PageLayoutType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ const (
|
|||||||
func (i PagePromotionType) String() string {
|
func (i PagePromotionType) String() string {
|
||||||
return []string{"microsoftReserved", "page", "newsPost", "unknownFutureValue"}[i]
|
return []string{"microsoftReserved", "page", "newsPost", "unknownFutureValue"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParsePagePromotionType(v string) (interface{}, error) {
|
func ParsePagePromotionType(v string) (interface{}, error) {
|
||||||
result := MICROSOFTRESERVED_PAGEPROMOTIONTYPE
|
result := MICROSOFTRESERVED_PAGEPROMOTIONTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -33,6 +34,7 @@ func ParsePagePromotionType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializePagePromotionType(values []PagePromotionType) []string {
|
func SerializePagePromotionType(values []PagePromotionType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -18,6 +18,7 @@ const (
|
|||||||
func (i SectionEmphasisType) String() string {
|
func (i SectionEmphasisType) String() string {
|
||||||
return []string{"none", "neutral", "soft", "strong", "unknownFutureValue"}[i]
|
return []string{"none", "neutral", "soft", "strong", "unknownFutureValue"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseSectionEmphasisType(v string) (interface{}, error) {
|
func ParseSectionEmphasisType(v string) (interface{}, error) {
|
||||||
result := NONE_SECTIONEMPHASISTYPE
|
result := NONE_SECTIONEMPHASISTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -36,6 +37,7 @@ func ParseSectionEmphasisType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializeSectionEmphasisType(values []SectionEmphasisType) []string {
|
func SerializeSectionEmphasisType(values []SectionEmphasisType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -16,6 +16,7 @@ const (
|
|||||||
func (i SiteAccessType) String() string {
|
func (i SiteAccessType) String() string {
|
||||||
return []string{"block", "full", "limited"}[i]
|
return []string{"block", "full", "limited"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseSiteAccessType(v string) (interface{}, error) {
|
func ParseSiteAccessType(v string) (interface{}, error) {
|
||||||
result := BLOCK_SITEACCESSTYPE
|
result := BLOCK_SITEACCESSTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -30,6 +31,7 @@ func ParseSiteAccessType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializeSiteAccessType(values []SiteAccessType) []string {
|
func SerializeSiteAccessType(values []SiteAccessType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -25,6 +25,7 @@ const (
|
|||||||
func (i SiteSecurityLevel) String() string {
|
func (i SiteSecurityLevel) String() string {
|
||||||
return []string{"userDefined", "low", "mediumLow", "medium", "mediumHigh", "high"}[i]
|
return []string{"userDefined", "low", "mediumLow", "medium", "mediumHigh", "high"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseSiteSecurityLevel(v string) (interface{}, error) {
|
func ParseSiteSecurityLevel(v string) (interface{}, error) {
|
||||||
result := USERDEFINED_SITESECURITYLEVEL
|
result := USERDEFINED_SITESECURITYLEVEL
|
||||||
switch v {
|
switch v {
|
||||||
@ -45,6 +46,7 @@ func ParseSiteSecurityLevel(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializeSiteSecurityLevel(values []SiteSecurityLevel) []string {
|
func SerializeSiteSecurityLevel(values []SiteSecurityLevel) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -18,6 +18,7 @@ const (
|
|||||||
func (i TitleAreaLayoutType) String() string {
|
func (i TitleAreaLayoutType) String() string {
|
||||||
return []string{"imageAndTitle", "plain", "colorBlock", "overlap", "unknownFutureValue"}[i]
|
return []string{"imageAndTitle", "plain", "colorBlock", "overlap", "unknownFutureValue"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseTitleAreaLayoutType(v string) (interface{}, error) {
|
func ParseTitleAreaLayoutType(v string) (interface{}, error) {
|
||||||
result := IMAGEANDTITLE_TITLEAREALAYOUTTYPE
|
result := IMAGEANDTITLE_TITLEAREALAYOUTTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -36,6 +37,7 @@ func ParseTitleAreaLayoutType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializeTitleAreaLayoutType(values []TitleAreaLayoutType) []string {
|
func SerializeTitleAreaLayoutType(values []TitleAreaLayoutType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -16,6 +16,7 @@ const (
|
|||||||
func (i TitleAreaTextAlignmentType) String() string {
|
func (i TitleAreaTextAlignmentType) String() string {
|
||||||
return []string{"left", "center", "unknownFutureValue"}[i]
|
return []string{"left", "center", "unknownFutureValue"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseTitleAreaTextAlignmentType(v string) (interface{}, error) {
|
func ParseTitleAreaTextAlignmentType(v string) (interface{}, error) {
|
||||||
result := LEFT_TITLEAREATEXTALIGNMENTTYPE
|
result := LEFT_TITLEAREATEXTALIGNMENTTYPE
|
||||||
switch v {
|
switch v {
|
||||||
@ -30,6 +31,7 @@ func ParseTitleAreaTextAlignmentType(v string) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SerializeTitleAreaTextAlignmentType(values []TitleAreaTextAlignmentType) []string {
|
func SerializeTitleAreaTextAlignmentType(values []TitleAreaTextAlignmentType) []string {
|
||||||
result := make([]string, len(values))
|
result := make([]string, len(values))
|
||||||
for i, v := range values {
|
for i, v := range values {
|
||||||
|
|||||||
@ -3,9 +3,9 @@ package api_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
discover "github.com/alcionai/corso/src/internal/connector/discovery/api"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
discover "github.com/alcionai/corso/src/internal/connector/discovery/api"
|
||||||
"github.com/alcionai/corso/src/internal/connector/graph"
|
"github.com/alcionai/corso/src/internal/connector/graph"
|
||||||
"github.com/alcionai/corso/src/pkg/account"
|
"github.com/alcionai/corso/src/pkg/account"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/pkg/logger"
|
"github.com/alcionai/corso/src/pkg/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,9 @@ package selectors
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/alcionai/clues"
|
||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
|
|
||||||
"github.com/alcionai/clues"
|
|
||||||
D "github.com/alcionai/corso/src/internal/diagnostics"
|
D "github.com/alcionai/corso/src/internal/diagnostics"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
"github.com/alcionai/corso/src/pkg/fault"
|
"github.com/alcionai/corso/src/pkg/fault"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user