1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-24 19:39:16 +02:00

17 Commits

Author SHA1 Message Date
Stefan Haller
50785a2217 Exclude vendor directory from linting
It seems to be excluded already when you run the lint.sh script, but in VS Code
when setting Lint on Save to package it would still lint a file in gocui when
you save it, which is annoying. (Remove the other paths that were there before;
they seem to be unused, and they were added by the auto-migration.)

Unfortunately, gopls will still lint gocui files with its builtin staticcheck
linter, and I couldn't find a way to turn this off. This might be a reason to
turn off staticcheck in gopls (not sure yet).
2025-07-03 16:39:52 +02:00
Stefan Haller
ca05a2ccea Enable revive linter, and fix a bunch of warnings
I took the set of enabled checks from revive's recommended configuration [1],
and removed some that I didn't like. There might be other useful checks in
revive that we might want to enable, but this is a nice improvement already.

The bulk of the changes here are removing unnecessary else statements after
returns, but there are a few others too.

[1] https://github.com/mgechev/revive?tab=readme-ov-file#recommended-configuration
2025-06-30 19:13:20 +02:00
Stefan Haller
7aa426fa71 Enable errorlint linter, and fix warnings 2025-06-30 18:30:11 +02:00
Stefan Haller
0471dbaa84 Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
Stefan Haller
1e92d8b7f3 Enable nolintlint linter, and fix warnings 2025-06-30 18:30:11 +02:00
Stefan Haller
c4de94cff0 Update .golangci.yml to use version 2
The config file was migrated using `golangci-lint migrate`, and then edited by
hand to disable a few checks that we don't want.
2025-06-30 18:30:11 +02:00
Kevin Radloff
be7583dd40 Update to go 1.24 2025-03-08 14:53:54 -05:00
Stefan Haller
8c553dcde9 Upgrade golang-ci to 1.60 2024-08-27 10:33:06 +02:00
kyu08
4a97fb80f3 Delete the TODO comment about enabling goconst in the future from .golangci.yml 2024-05-24 22:29:44 +09:00
kyu08
6cf6941a77 Add copyloopvar to enabled linters 2024-05-22 21:57:34 +09:00
Jesse Duffield
9124d8dbaa Bump go version to 1.22 2024-05-19 16:38:21 +10:00
Stefan Haller
57ac9c2189 Bump required go version to 1.21
We'll need this to use the slices.Sort function in the next commit. It would
also be possible to use sort.Ints instead, but it's slower.
2024-02-16 13:51:15 +01:00
Jesse Duffield
3e2ef84d56 Ignore deprecation checks in linter
This is pretty funny: the staticcheck linter gets mad if we use a field which is marked
in a comment as being deprecated. But it tripped on my own comment saying that a field
is deprecated in terms of the user config!

Obviously we have to make use of this field, otherwise we would just remove it entirely
rather than mark it as deprecated, so I'm silencing this lint.

I doubt this lint would actually come in handy in other cases (like when using a third
party package) and worst case scenario we just end up fixing the problem when we
try to upgrade the package and the deprecated field is now gone).
2023-09-30 19:24:59 +10:00
Jesse Duffield
df0c3b3ea8 Increase timeout for linter
we've had a timeout issue in CI
2023-08-02 08:32:57 +10:00
Jesse Duffield
975d2bedb6 Remove secureexec package
From the go 1.19 release notes:

Command and LookPath no longer allow results from a PATH search to be found relative to the current directory. This removes a common source of security problems but may also break existing programs that depend on using, say, exec.Command("prog") to run a binary named prog (or, on Windows, prog.exe) in the current directory. See the os/exec package documentation for information about how best to update such programs.
2023-07-30 19:59:51 +10:00
Jesse Duffield
f9979879a1 no more naked returns 2022-03-25 23:27:28 +11:00
Jesse Duffield
a34bdf1a04 update linters 2022-03-19 12:12:57 +11:00