Skip to content

dev/sg: add logging migration linter, add repo.State to lint.Runner

Warren Gifford requested to merge lib-log-linter into main

Created by: bobheadxi

  • lint.Runner implementations can now leverage detailed diff information to optimize linting
  • Add a new linter, sg lint logger-migration, and corresponding CI job. Separate from sg lint go because we don't use sg lint go yet: https://github.com/sourcegraph/sourcegraph/issues/33363

Closes https://github.com/sourcegraph/sourcegraph/issues/34482

Test plan

Locally:

➜  sourcegraph git:(lib-log-linter) go run ./dev/sg lint logger-migration   
❌ Logging library linter (0s)
dev/sg/lints.go:77: banned usage '"log"': use github.com/sourcegraph/sourcegraph/lib/log instead
Done running linters.
error: failed linters: Logging library linter
exit status 1

In CI:

image

Merge request reports

Loading