gofmt is needed for the build (#8678)

**What this PR does / why we need it**:

`gofmt` is needed for the build, `make format` fails without it.
pull/8791/head
Trevor Whitney 3 years ago committed by GitHub
parent 4854e4af89
commit b46e392adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      .golangci.yml
  2. 1
      flake.nix
  3. 6
      nix/faillint.nix
  4. 4
      pkg/ruler/base/ruler.go
  5. 1
      pkg/storage/chunk/client/aws/s3_storage_client.go
  6. 49
      pkg/storage/stores/indexshipper/compactor/compactor_test.go
  7. 1
      pkg/util/log/line_buffer_test.go
  8. 33
      tools/doc-generator/main.go

@ -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;
@ -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"

@ -145,6 +145,7 @@
nettools
golangci-lint
gotools
helm-docs
faillint
chart-testing

@ -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;
}

@ -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 (

@ -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{

@ -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 {

@ -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") }
)

@ -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()

Loading…
Cancel
Save