Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #28 from tulilirockz/main
Browse files Browse the repository at this point in the history
feat: linting + precommit + devcontainer
  • Loading branch information
bketelsen authored Feb 20, 2024
2 parents 8919860 + 7641bf6 commit 3de1c75
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM docker.io/library/fedora:latest

RUN dnf update -y && dnf install device-mapper-devel gpgme-devel btrfs-progs-devel golang-go golint golang-honnef-tools golang-mvdan-gofumpt && dnf clean all -y
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "Go",
"dockerFile": ".devcontainer/Containerfile",
"workspaceMount": ".",
}
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-symlinks
- id: check-added-large-files
- repo: https://github.com/golangci/golangci-lint
rev: v1.56.2
hooks:
- id: golangci-lint-full
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
- repo: https://github.com/mrtazz/checkmake.git
rev: 0.2.2
hooks:
- id: checkmake
- repo: https://github.com/Bahjat/pre-commit-golang
rev: v1.0.2
hooks:
- id: go-fmt-import
- id: go-vet
- id: go-lint
- id: go-unit-tests
- id: gofumpt # requires github.com/mvdan/gofumpt
- id: go-static-check # install https://staticcheck.io/docs/
4 changes: 1 addition & 3 deletions bext-rpm-distrobox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[bext-devbox]
additional_packages="rpkg rpmdevtools copr-cli tito rpm-build"
image=fedora:latest
image=docker.io/library/fedora:latest
init=false
start_now=true
init_hooks="touch /init-normal"
nvidia=true
pre_init_hooks="touch /pre-init"
pull=true
root=false
replace=false
6 changes: 2 additions & 4 deletions build-distrobox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[build-devbox]
additional_packages="device-mapper-devel gpgme-devel btrfs-progs-devel golang-go"
image=fedora:latest
additional_packages="device-mapper-devel gpgme-devel btrfs-progs-devel golang-go golint golang-honnef-tools golang-mvdan-gofumpt"
image=docker.io/library/fedora:latest
init=false
start_now=true
init_hooks="touch /init-normal"
nvidia=true
pre_init_hooks="touch /pre-init"
pull=true
root=false
replace=false
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
in {
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
packages = with pkgs; [cobra-cli gopls eclint apko melange] ++ bext_deps.build ++ bext_deps.runtime;
packages = with pkgs; [cobra-cli gopls eclint apko melange golangci-lint errcheck go-tools] ++ bext_deps.build ++ bext_deps.runtime;
};
packages = {
default = self.packages.${system}.bext;
Expand Down

0 comments on commit 3de1c75

Please sign in to comment.