Skip to content

Commit

Permalink
golangci: Ignore gci errors in CGO files.
Browse files Browse the repository at this point in the history
It is possible to change these files to keep them in line with gci but
that requires moving all C code to the beginning of the import block,
then importing C, and then importing everything else. I think this looks
less clean than how we currently do it, so ignoring these files.

Signed-off-by: Mark Laing <[email protected]>
  • Loading branch information
markylaing committed Jul 14, 2023
1 parent be475b3 commit dfe5d28
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
issues:
# Ignore gci for all CGO files.
exclude-rules:
- path: 'lxd/seccomp/cgo\.go'
linters:
- gci
- path: 'lxd/seccomp/seccomp\.go'
linters:
- gci
- path: 'lxd/main_forkuevent\.go'
linters:
- gci
- path: 'lxd/main_forknet\.go'
linters:
- gci
- path: 'lxd/main_checkfeature\.go'
linters:
- gci
- path: 'lxd/main_forkproxy\.go'
linters:
- gci
- path: 'lxd/cgo\.go'
linters:
- gci
- path: 'lxd/main_forkfile\.go'
linters:
- gci
- path: 'lxd/main_nsexec\.go'
linters:
- gci
- path: 'lxd/main_forkexec\.go'
linters:
- gci
- path: 'lxd/main_forksyscall\.go'
linters:
- gci
- path: 'lxd/storage/quota/cgo\.go'
linters:
- gci
- path: 'lxd/storage/quota/projectquota\.go'
linters:
- gci
- path: 'lxd/main_forkcoresched\.go'
linters:
- gci
- path: 'lxd/main_forkmount\.go'
linters:
- gci
- path: 'lxd/devices\.go'
linters:
- gci
- path: 'shared/cgo\.go'
linters:
- gci
- path: 'shared/linux/socket_linux_cgo\.go'
linters:
- gci
- path: 'shared/idmap/shift_linux\.go'
linters:
- gci
- path: 'shared/idmap/cgo\.go'
linters:
- gci
- path: 'shared/netutils/cgo\.go'
linters:
- gci
- path: 'shared/netutils/network_linux_cgo\.go'
linters:
- gci
- path: 'lxc-to-lxd/main.go'
linters:
- gci

linters:
enable:
- gofmt
Expand Down

0 comments on commit dfe5d28

Please sign in to comment.