Commit Graph

3 Commits

Author SHA1 Message Date
Denis Bilenko c262b75c3d
Make lint.sh to run golangci-lint only once in the best case (#2062)
Follow up to #2051 and #2056.

Running golangci-lint twice always is measurably slower (1.5s vs 2.5s),
so only run it twice in case it is necessary.
2025-01-02 11:33:06 +01:00
Denis Bilenko 1ce20a2612
lint.sh: read config for formatters; include gofmt (#2056)
As suggested here:
https://github.com/databricks/cli/pull/2051#discussion_r1899641273
2024-12-30 18:39:33 +00:00
Denis Bilenko e088d0d996
Add lint.sh to run golanci-lint in 2 stages (#2051)
First stage is to run goimports and formatter, second is full suite.

This ensures that imports and formatting are fixed even in presence of
other issues. Otherwise golanci-lint refuses to fix anything
https://github.com/golangci/golangci-lint/issues/5257

This helpful when running aider with config like this - aider will use
that to autofix what it can after every update:

```
% cat .aider.conf.yml
lint-cmd:
  - "go: ./lint.sh"
```
2024-12-30 15:18:57 +00:00