Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
gofmt is needed for the build (grafana#8678)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:

`gofmt` is needed for the build, `make format` fails without it.
  • Loading branch information
trevorwhitney authored Mar 13, 2023
1 parent 4854e4a commit b46e392
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 95 deletions.
11 changes: 7 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ run:
tests: true

# list of build tags, all linters use it. Default is empty list.
build-tags: []
build-tags:
- linux
- cgo
- promtail_journal_enabled

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
Expand All @@ -33,9 +36,9 @@ run:
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- .*.pb.go
- .*.y.go
- .*.rl.go
- .*.pb.go
- .*.y.go
- .*.rl.go
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
nettools

golangci-lint
gotools
helm-docs
faillint
chart-testing
Expand Down
6 changes: 3 additions & 3 deletions nix/faillint.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

buildGoModule rec {
pname = "faillint";
version = "1.10.0";
version = "1.11.0";

src = fetchFromGitHub {
owner = "fatih";
repo = "faillint";
rev = "v${version}";
sha256 = "0y8m39iir7cry3svmwvv9fbfld6y5k6asimmhs0f4rk8f9czriv8";
sha256 = "ZSTeNp8r+Ab315N1eVDbZmEkpQUxmmVovvtqBBskuI4=";
};

vendorSha256 = "yN8KHpHfBN9Gv6BVdA5AQhYSJ7fwH9k9ZgkuNYHF0kc=";
vendorSha256 = "5OR6Ylkx8AnDdtweY1B9OEcIIGWsY8IwTHbR/LGnqFI=";
doCheck = false;
}
4 changes: 0 additions & 4 deletions pkg/ruler/base/ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ import (
var (
supportedShardingStrategies = []string{util.ShardingStrategyDefault, util.ShardingStrategyShuffle}
supportedShardingAlgos = []string{util.ShardingAlgoByGroup, util.ShardingAlgoByRule}

// Validation errors.
errInvalidShardingStrategy = errors.New("invalid sharding strategy")
errInvalidTenantShardSize = errors.New("invalid tenant shard size, the value must be greater than 0")
)

const (
Expand Down
1 change: 0 additions & 1 deletion pkg/storage/chunk/client/aws/s3_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const (
var (
supportedSignatureVersions = []string{SignatureVersionV4, SignatureVersionV2}
errUnsupportedSignatureVersion = errors.New("unsupported signature version")
errUnsupportedStorageClass = errors.New("unsupported S3 storage class")
)

var s3RequestDuration = instrument.NewHistogramCollector(prometheus.NewHistogramVec(prometheus.HistogramOpts{
Expand Down
49 changes: 0 additions & 49 deletions pkg/storage/stores/indexshipper/compactor/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,6 @@ func dayFromTime(t model.Time) config.DayTime {

var (
start = model.Now().Add(-30 * 24 * time.Hour)
schemaCfg = config.SchemaConfig{
// we want to test over all supported schema.
Configs: []config.PeriodConfig{
{
From: dayFromTime(start),
IndexType: "boltdb",
ObjectType: "filesystem",
Schema: "v9",
IndexTables: config.PeriodicTableConfig{
Prefix: indexTablePrefix,
Period: time.Hour * 24,
},
RowShards: 16,
},
{
From: dayFromTime(start.Add(25 * time.Hour)),
IndexType: "boltdb",
ObjectType: "filesystem",
Schema: "v10",
IndexTables: config.PeriodicTableConfig{
Prefix: indexTablePrefix,
Period: time.Hour * 24,
},
RowShards: 16,
},
{
From: dayFromTime(start.Add(73 * time.Hour)),
IndexType: "boltdb",
ObjectType: "filesystem",
Schema: "v11",
IndexTables: config.PeriodicTableConfig{
Prefix: indexTablePrefix,
Period: time.Hour * 24,
},
RowShards: 16,
},
{
From: dayFromTime(start.Add(100 * time.Hour)),
IndexType: "boltdb",
ObjectType: "filesystem",
Schema: "v12",
IndexTables: config.PeriodicTableConfig{
Prefix: indexTablePrefix,
Period: time.Hour * 24,
},
RowShards: 16,
},
},
}
)

func setupTestCompactor(t *testing.T, tempDir string) *Compactor {
Expand Down
1 change: 0 additions & 1 deletion pkg/util/log/line_buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,4 @@ func benchmarkRunner(b *testing.B, logger log.Logger, f func(log.Logger)) {

var (
baseMessage = func(logger log.Logger) { logger.Log("foo_key", "foo_value") }
withMessage = func(logger log.Logger) { log.With(logger, "a", "b").Log("c", "d") }
)
33 changes: 0 additions & 33 deletions tools/doc-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,39 +99,6 @@ func generateBlocksMarkdown(blocks []*parse.ConfigBlock) string {
return md.string()
}

func generateBlockMarkdown(blocks []*parse.ConfigBlock, blockName, fieldName string) string {
// Look for the requested block.
for _, block := range blocks {
if block.Name != blockName {
continue
}

md := &markdownWriter{}

// Wrap the root block with another block, so that we can show the name of the
// root field containing the block specs.
md.writeConfigBlock(&parse.ConfigBlock{
Name: blockName,
Desc: block.Desc,
Entries: []*parse.ConfigEntry{
{
Kind: parse.KindBlock,
Name: fieldName,
Required: true,
Block: block,
BlockDesc: "",
Root: false,
},
},
})

return md.string()
}

// If the block has not been found, we return an empty string.
return ""
}

func main() {
// Parse the generator flags.
flag.Parse()
Expand Down

0 comments on commit b46e392

Please sign in to comment.