From d81882f6e955863990a7759bb6ad46b1d2bd1d79 Mon Sep 17 00:00:00 2001 From: dylan Date: Mon, 28 Oct 2024 11:22:02 -0700 Subject: [PATCH] fix linting --- .golangci.yml | 32 +++++++++++++++----------------- cmd/writers/indexList.go | 4 ++-- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f4ce6fe..e4a3fd2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -76,20 +76,18 @@ run: # skip-files: # - sample -# issues: -# exclude-rules: -# - path: info/as_parser_test\.go -# linters: -# - lll # Test code is allowed to have long lines -# - path: asconfig/generate_test\.go -# linters: -# - dupl # Test code is allowed to have duplicate code -# - path: asconfig/asconfig_test\.go -# linters: -# - dupl # Test code is allowed to have duplicate code -# - path: '(.+)test\.go' -# linters: -# - govet # Test code field alignment for sake of space is not a concern -# - linters: -# - lll -# source: "// " +issues: + exclude-rules: + - path: info/as_parser_test\.go + linters: + - lll # Test code is allowed to have long lines + - path: asconfig/generate_test\.go + linters: + - dupl # Test code is allowed to have duplicate code + - path: asconfig/asconfig_test\.go + linters: + - dupl # Test code is allowed to have duplicate code + - path: '(.+)test\.go' + linters: + - govet # Test code field alignment for sake of space is not a concern + - wsl # Auto generated tests cuddle assignments diff --git a/cmd/writers/indexList.go b/cmd/writers/indexList.go index e8ab76d..819025e 100644 --- a/cmd/writers/indexList.go +++ b/cmd/writers/indexList.go @@ -157,8 +157,7 @@ func calculateIndexSize(index *protos.IndexDefinition, status *protos.IndexStatu // Each index record has ~500 bytes of overhead + the vector size indexRecSize := 500 + vectorSize // The total size is the number of records times the size of each record - indexSize := indexRecSize * status.GetIndexHealerVerticesValid() - return indexSize + return indexRecSize * status.GetIndexHealerVerticesValid() } // formatBytes converts bytes to human readable string format @@ -190,6 +189,7 @@ func formatBytes(bytes int64) string { func getPercentUnmerged(status *protos.IndexStatusResponse) string { unmergedCount := status.GetUnmergedRecordCount() + verticies := status.GetIndexHealerVerticesValid() if verticies == 0 { return "0%"