mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 13:02:12 +08:00
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>
This commit is contained in:
@ -734,8 +734,10 @@ jobs:
|
||||
name: Lint Go
|
||||
command: |
|
||||
go vet ./pkg/...
|
||||
# Adjust golangci-lint concurrency since it can run out of memory
|
||||
golangci-lint run -v -j 2 --config scripts/go/configs/.golangci.yml ./pkg/...
|
||||
golangci-lint run -v -j 2 --config scripts/go/configs/ci/.golangci.yml -E deadcode -E gofmt \
|
||||
-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 ./pkg/services/alerting/...
|
||||
./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) => (
|
||||
ref={ref}
|
||||
type="text"
|
||||
className={props.inputClassName}
|
||||
value={unEscapeStringFromRegex(props.value)}
|
||||
value={props.value ? unEscapeStringFromRegex(props.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" />
|
||||
</label>
|
||||
|
@ -344,8 +344,8 @@ export default class TimeSeries {
|
||||
|
||||
updateLegendValues(formater: ValueFormatter, decimals: DecimalCount, scaledDecimals: DecimalCount) {
|
||||
this.valueFormater = formater;
|
||||
this.decimals = decimals;
|
||||
this.scaledDecimals = scaledDecimals;
|
||||
this.decimals = decimals ?? 0;
|
||||
this.scaledDecimals = scaledDecimals ?? 0;
|
||||
}
|
||||
|
||||
formatValue(value: number) {
|
||||
|
12
scripts/go/configs/ci/.golangci.yml
Normal file
12
scripts/go/configs/ci/.golangci.yml
Normal file
@ -0,0 +1,12 @@
|
||||
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
|
Reference in New Issue
Block a user