Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply more golang cli linter #676

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5d6bbab
add treefmt
Mic92 Nov 17, 2024
76aa784
delete duplicate shell.nix
Mic92 Nov 17, 2024
7b60015
reformat with treefmt
Mic92 Nov 17, 2024
a33e8cc
enable shellcheck
Mic92 Nov 17, 2024
887d4b7
enable gofumpt
Mic92 Nov 17, 2024
15541d5
bump go version to 1.22
Mic92 Nov 17, 2024
9190dee
sops-pgp-hook: set parallel and helper
Mic92 Nov 17, 2024
3ba597a
remove sops-pgp-hook
Mic92 Nov 17, 2024
ae893d1
hook_test: fix linter errors
Mic92 Nov 17, 2024
975c685
unittest: set t.Helper() and t.Parallel()
Mic92 Nov 17, 2024
4d5d1b7
fix wsl lints
Mic92 Nov 17, 2024
582b2a8
remove space before nolint
Mic92 Nov 17, 2024
d5e0983
tests: move NOBODY/NOGROUP into a constant
Mic92 Nov 20, 2024
f57a556
apply golangci-lints
Mic92 Nov 20, 2024
1475325
tests: avoid sprint for simple string concatination
Mic92 Nov 20, 2024
4bc1bfd
tests: avoid type shadowing
Mic92 Nov 20, 2024
d1b8b2a
fix wsl lints
Mic92 Nov 20, 2024
3e7cba9
wrap all external errors
Mic92 Nov 20, 2024
1b80162
don't capatalize errors
Mic92 Nov 20, 2024
fc20a8f
add newlines before return
Mic92 Nov 20, 2024
1f66022
don't use named returns
Mic92 Nov 20, 2024
35a8641
always check for errors on type casting
Mic92 Nov 20, 2024
fa1c48a
check for is dry activation in one place
Mic92 Nov 20, 2024
17bc783
use switch case where possible
Mic92 Nov 20, 2024
035bd53
avoid various type conversions i.e. int -> uint32
Mic92 Nov 20, 2024
c4a672f
importAgeSSHKeys never returnss an error
Mic92 Nov 20, 2024
a2b11a4
ingore recvcheck lint for FormatType
Mic92 Nov 20, 2024
1674c94
enable more golangci-lint checks
Mic92 Nov 20, 2024
563411a
unit-test: pass in sops-install-secrets via callPackage
Mic92 Nov 24, 2024
915b7c3
move lint and cross-build to flake.nix
Mic92 Nov 24, 2024
b93e7c4
default.nix: don't use rec
Mic92 Nov 24, 2024
a43bb04
fix vendor hash
Mic92 Nov 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# shellcheck shell=bash
use flake
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
- master
schedule:
- cron: '51 2 * * *'
- cron: "51 2 * * *"
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- name: Add keys group (needed for go tests)
run: sudo groupadd keys
- name: Run unit tests
run: nix develop .#unit-tests --command "true"
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- name: Add keys group (needed for go tests)
run: sudo groupadd keys
- name: Run unit tests
run: nix develop .#unit-tests --command "true"
12 changes: 6 additions & 6 deletions .github/workflows/upgrade-flakes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '51 2 * * 0'
- cron: "51 2 * * 0"

permissions:
pull-requests: write
Expand All @@ -20,10 +20,10 @@ jobs:
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Update flakes
run: |
nix flake update
pushd dev/private
nix flake update
popd
nix run .#update-dev-private-narHash
nix flake update
pushd dev/private
nix flake update
popd
nix run .#update-dev-private-narHash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
28 changes: 18 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
linters:
presets:
- bugs
- unused
enable:
- gofmt
- misspell
- revive
- stylecheck
enable-all: true
disable:
# direnv is not a web server, context is not strictly necessary.
- noctx
- cyclop
- depguard
- dogsled
- err113
- exhaustruct
- exportloopref
- forbidigo
- funlen
- gocognit
- gocyclo
- godot
- godox
- lll
- maintidx
- mnd
- nestif
- varnamelen
Loading