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

Intial Commit Review. #1

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for Go
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22"]

steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
# You can test your matrix by printing the current Go version

- name: Get dependencies
run: |
go get -v -t ./...
go install gotest.tools/gotestsum@latest

- name: modVerify
run: go mod verify

- name: Run Tests with go testsum
run: gotestsum --format pkgname --jsonfile test.json

- name: Annotate tests
if: always()
uses: guyarb/golang-test-annotations@v0.8.0
with:
test-results: test.json
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
pull_request:
branches: ["**"]
env:
GOPRIVATE: github.com/DIMO-Network
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
golangci:
runs-on: ubuntu-latest

name: lint
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Checkout code
uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
only-new-issues: false
args: --modules-download-mode=readonly --timeout=5m
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# binary only
codegen
!codegen/
!codegen/*

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Go workspace file
go.work

# VS code files
.vscode/*
*.code-workspace
.history/

# allow launch.json
!.vscode/launch.json

# GoLand
.idea/


63 changes: 63 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
linters-settings:
funlen:
lines: 100
statements: 50
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/DIMO-Network/mnemonic
govet:
check-shadowing: true
misspell:
locale: US
ignore-words:
- artefact
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: true # require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
revive:
confidence: 0

linters:
disable-all: true
enable:
- bodyclose
- dogsled
- dupl
- errcheck
- exportloopref
- funlen
- gocritic
- goconst
- gocyclo
- gofumpt
- goimports
- revive
- rowserrcheck
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- noctx
- nolintlint
- staticcheck
- stylecheck
- sqlclosecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace

issues:
# enable issues excluded by default
exclude-use-default: false
exclude-rules:
# Exclude some linters from running on tests files.
- path: convert-funcs_test\.go
linters:
- dupl
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run codegen",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/internal/codegen/cmd",
"args": [
"-output=${workspaceFolder}/pkg/vss",
"-spec=${workspaceFolder}/schema/vss_rel_4.2-DIMO.csv",
"-migrations=${workspaceFolder}/schema/migrations.json",
"-package=vss"
]
}
]
}
Loading
Loading