Commit 15455ab5 by Arve Knudsen Committed by GitHub

CircleCI: Run golangci-lint in two batches (#23021)

* CircleCI: Run golangci-lint in two batches

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CircleCI: Fix typo

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: adds fallback value to time series class

* Chore: changes fallback value from null to empty string in FilterInput component

* Update public/app/core/time_series2.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@grafana.com>

* Chore: updates || to ?? operators

Co-authored-by: Lukas Siatka <lukasz.siatka@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
parent 014e7d92
...@@ -734,8 +734,10 @@ jobs: ...@@ -734,8 +734,10 @@ jobs:
name: Lint Go name: Lint Go
command: | command: |
go vet ./pkg/... go vet ./pkg/...
# Adjust golangci-lint concurrency since it can run out of memory golangci-lint run -v -j 2 --config scripts/go/configs/ci/.golangci.yml -E deadcode -E gofmt \
golangci-lint run -v -j 2 --config scripts/go/configs/.golangci.yml ./pkg/... -E gosimple -E ineffassign -E structcheck -E typecheck ./pkg/...
golangci-lint run -v -j 2 --config scripts/go/configs/ci/.golangci.yml -E unconvert -E unused \
-E varcheck -E goconst -E errcheck -E staticcheck ./pkg/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive.toml ./pkg/... ./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive.toml ./pkg/...
./scripts/go/bin/revive -formatter stylish ./pkg/services/alerting/... ./scripts/go/bin/revive -formatter stylish ./pkg/services/alerting/...
./scripts/go/bin/gosec -quiet -exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \ ./scripts/go/bin/gosec -quiet -exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \
......
...@@ -15,9 +15,9 @@ export const FilterInput = forwardRef<HTMLInputElement, Props>((props, ref) => ( ...@@ -15,9 +15,9 @@ export const FilterInput = forwardRef<HTMLInputElement, Props>((props, ref) => (
ref={ref} ref={ref}
type="text" type="text"
className={props.inputClassName} className={props.inputClassName}
value={unEscapeStringFromRegex(props.value)} value={props.value ? unEscapeStringFromRegex(props.value) : ''}
onChange={event => props.onChange(escapeStringForRegex(event.target.value))} onChange={event => props.onChange(escapeStringForRegex(event.target.value))}
placeholder={props.placeholder ? props.placeholder : null} placeholder={props.placeholder ?? ''}
/> />
<i className="gf-form-input-icon fa fa-search" /> <i className="gf-form-input-icon fa fa-search" />
</label> </label>
......
...@@ -344,8 +344,8 @@ export default class TimeSeries { ...@@ -344,8 +344,8 @@ export default class TimeSeries {
updateLegendValues(formater: ValueFormatter, decimals: DecimalCount, scaledDecimals: DecimalCount) { updateLegendValues(formater: ValueFormatter, decimals: DecimalCount, scaledDecimals: DecimalCount) {
this.valueFormater = formater; this.valueFormater = formater;
this.decimals = decimals; this.decimals = decimals ?? 0;
this.scaledDecimals = scaledDecimals; this.scaledDecimals = scaledDecimals ?? 0;
} }
formatValue(value: number) { formatValue(value: number) {
......
run:
timeout: 10m
linters:
disable-all: true
linters-settings:
goconst:
# minimal length of string constant, 3 by default
min-len: 5
# minimal occurrences count to trigger, 3 by default
min-occurrences: 5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment