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
|
||||
staticcheck ./...
|
||||
|
||||
fmt:
|
||||
gofumpt -w .
|
||||
gci write --skip-generated -s 'standard,default,prefix(github.com/alcionai/corso)' .
|
||||
|
||||
check-lint-version: check-lint
|
||||
@if [ "$(LINT_VERSION)" != "$(WANTED_LINT_VERSION)" ]; then \
|
||||
echo >&2 $(BAD_LINT_MSG); \
|
||||
|
||||
@ -21,6 +21,7 @@ const (
|
||||
func (i HorizontalSectionLayoutType) String() string {
|
||||
return []string{"none", "oneColumn", "twoColumns", "threeColumns", "oneThirdLeftColumn", "oneThirdRightColumn", "fullWidth", "unknownFutureValue"}[i]
|
||||
}
|
||||
|
||||
func ParseHorizontalSectionLayoutType(v string) (interface{}, error) {
|
||||
result := NONE_HORIZONTALSECTIONLAYOUTTYPE
|
||||
switch v {
|
||||
@ -45,6 +46,7 @@ func ParseHorizontalSectionLayoutType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializeHorizontalSectionLayoutType(values []HorizontalSectionLayoutType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -17,6 +17,7 @@ const (
|
||||
func (i PageLayoutType) String() string {
|
||||
return []string{"microsoftReserved", "article", "home", "unknownFutureValue"}[i]
|
||||
}
|
||||
|
||||
func ParsePageLayoutType(v string) (interface{}, error) {
|
||||
result := MICROSOFTRESERVED_PAGELAYOUTTYPE
|
||||
switch v {
|
||||
@ -33,6 +34,7 @@ func ParsePageLayoutType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializePageLayoutType(values []PageLayoutType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -17,6 +17,7 @@ const (
|
||||
func (i PagePromotionType) String() string {
|
||||
return []string{"microsoftReserved", "page", "newsPost", "unknownFutureValue"}[i]
|
||||
}
|
||||
|
||||
func ParsePagePromotionType(v string) (interface{}, error) {
|
||||
result := MICROSOFTRESERVED_PAGEPROMOTIONTYPE
|
||||
switch v {
|
||||
@ -33,6 +34,7 @@ func ParsePagePromotionType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializePagePromotionType(values []PagePromotionType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -18,6 +18,7 @@ const (
|
||||
func (i SectionEmphasisType) String() string {
|
||||
return []string{"none", "neutral", "soft", "strong", "unknownFutureValue"}[i]
|
||||
}
|
||||
|
||||
func ParseSectionEmphasisType(v string) (interface{}, error) {
|
||||
result := NONE_SECTIONEMPHASISTYPE
|
||||
switch v {
|
||||
@ -36,6 +37,7 @@ func ParseSectionEmphasisType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializeSectionEmphasisType(values []SectionEmphasisType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -16,6 +16,7 @@ const (
|
||||
func (i SiteAccessType) String() string {
|
||||
return []string{"block", "full", "limited"}[i]
|
||||
}
|
||||
|
||||
func ParseSiteAccessType(v string) (interface{}, error) {
|
||||
result := BLOCK_SITEACCESSTYPE
|
||||
switch v {
|
||||
@ -30,6 +31,7 @@ func ParseSiteAccessType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializeSiteAccessType(values []SiteAccessType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -25,6 +25,7 @@ const (
|
||||
func (i SiteSecurityLevel) String() string {
|
||||
return []string{"userDefined", "low", "mediumLow", "medium", "mediumHigh", "high"}[i]
|
||||
}
|
||||
|
||||
func ParseSiteSecurityLevel(v string) (interface{}, error) {
|
||||
result := USERDEFINED_SITESECURITYLEVEL
|
||||
switch v {
|
||||
@ -45,6 +46,7 @@ func ParseSiteSecurityLevel(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializeSiteSecurityLevel(values []SiteSecurityLevel) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -18,6 +18,7 @@ const (
|
||||
func (i TitleAreaLayoutType) String() string {
|
||||
return []string{"imageAndTitle", "plain", "colorBlock", "overlap", "unknownFutureValue"}[i]
|
||||
}
|
||||
|
||||
func ParseTitleAreaLayoutType(v string) (interface{}, error) {
|
||||
result := IMAGEANDTITLE_TITLEAREALAYOUTTYPE
|
||||
switch v {
|
||||
@ -36,6 +37,7 @@ func ParseTitleAreaLayoutType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializeTitleAreaLayoutType(values []TitleAreaLayoutType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -16,6 +16,7 @@ const (
|
||||
func (i TitleAreaTextAlignmentType) String() string {
|
||||
return []string{"left", "center", "unknownFutureValue"}[i]
|
||||
}
|
||||
|
||||
func ParseTitleAreaTextAlignmentType(v string) (interface{}, error) {
|
||||
result := LEFT_TITLEAREATEXTALIGNMENTTYPE
|
||||
switch v {
|
||||
@ -30,6 +31,7 @@ func ParseTitleAreaTextAlignmentType(v string) (interface{}, error) {
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func SerializeTitleAreaTextAlignmentType(values []TitleAreaTextAlignmentType) []string {
|
||||
result := make([]string, len(values))
|
||||
for i, v := range values {
|
||||
|
||||
@ -3,9 +3,9 @@ package api_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
discover "github.com/alcionai/corso/src/internal/connector/discovery/api"
|
||||
"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/pkg/account"
|
||||
)
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
|
||||
"github.com/alcionai/corso/src/pkg/logger"
|
||||
)
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@ package selectors
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
"golang.org/x/exp/maps"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
D "github.com/alcionai/corso/src/internal/diagnostics"
|
||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||
"github.com/alcionai/corso/src/pkg/fault"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user