Skip to content

Commit

Permalink
Initial Lilipod Commit
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Sep 7, 2023
0 parents commit 2ff84e5
Show file tree
Hide file tree
Showing 903 changed files with 323,338 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

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

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

# Dependency directories (remove the comment below to include it)
# vendor/
tags
dist
lilipod
*.sh
TODO.*
bin/
pkg/constants/pty.tar.gz
pty.tar.gz
pty
coverage
135 changes: 135 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
# All possible options can be found here
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
# Deprecated
# - deadcode
# - golint
# - interfacer
# - maligned
# - scopelint
# - structcheck
# - varcheck
# - exhaustivestruct
# - ifshort
# - nosnakecase
linters-settings:
# Allow names like fd for file descriptors, or id for identifiers.
varnamelen:
min-name-length: 2
nestif:
min-complexity: 10
gosec:
excludes:
- G204 # We actually need to launch programs with a variable name.
- G301 # We actually need to set permissions higher than 0750.
- G302 # We actually need to set permissions higher than 0600.
- G304 # Yes we use variables for file names.
- G401 # We actually use md5 only to create IDs, it's ok.
- G501 # like above.

issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0

linters:
# enable-all: true
fase: false
disable:
- exhaustruct # too noisy
- gomnd # too noisy
- forbidigo # I need to use println this is a CLI app.
- gochecknoglobals # Sometimes they are useful.
- goerr113 # I do use fmt.Errorf, allocating all of them at the start is counter productive.
- cyclop # To be enabled in the future
- funlen # To be enabled in the future
- gocognit # To be enabled in the future
- gocyclo # To be enabled in the future
- wrapcheck # To be enabled in the future
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forcetypeassert
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- goconst
- gocritic
- godot
- godox
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- varnamelen
- wastedassign
- whitespace
- wsl
- zerologlint
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: all lilipod pty coverage

all: clean pty lilipod

clean:
@rm -f lilipod
@rm -f pty
@rm -f pty.tar.gz

lilipod:
@rm -f lilipod
CGO_ENABLED=0 go build -mod vendor -ldflags="-s -w -X 'github.com/89luca89/lilipod/pkg/constants.Version=$${RELEASE_VERSION:-0.0.0}'" -o lilipod main.go

coverage:
@rm -rf coverage/*
@mkdir -p coverage
CGO_ENABLED=0 go build -mod vendor -cover -o coverage/pty ptyagent/main.go ptyagent/pty.go
@rm -f pty
@rm -f pty.tar.gz
CGO_ENABLED=0 go build -mod vendor -gcflags=all="-l -B -C" -ldflags="-s -w" -o pty ptyagent/main.go ptyagent/pty.go
tar czfv pty.tar.gz pty
CGO_ENABLED=0 go build -mod vendor -cover -o coverage/lilipod main.go

pty:
@rm -f pty
@rm -f pty.tar.gz
CGO_ENABLED=0 go build -mod vendor -gcflags=all="-l -B -C" -ldflags="-s -w -X 'main.version=$${RELEASE_VERSION:-0.0.0}'" -o pty ptyagent/main.go ptyagent/pty.go
tar czfv pty.tar.gz pty
Loading

0 comments on commit 2ff84e5

Please sign in to comment.