dev/ci: make sg lint in CI conditional, unify linter steps
Created by: bobheadxi
The culmination of https://github.com/sourcegraph/sourcegraph/pull/35205 and related PRs! Introduces changed.GetLintTargets
which is used to decide what sg lint
gets run. No more weird linters on your PRs hopefully!
We assert all lints are valid with a unit test that pulls from dev/sg/linters
(had to move the package again sorry, but since we want to encourage contributions to linters a more top-level package might make sense here). Ideally the condition would be inverted, with linters
defining changed.Diff
types to proc on, but right now changed
is an enterprise package.
Closes https://github.com/sourcegraph/sourcegraph/issues/33363 , closes https://github.com/sourcegraph/sourcegraph/pull/35331
Test plan
sg lint
etc still works as expected, CI passes!