Skip to content

Commit

Permalink
Init Project haste-client v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciferMorningstarDev committed Feb 14, 2023
0 parents commit 460db42
Show file tree
Hide file tree
Showing 10 changed files with 1,027 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
branches: [main]
pull_request:

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}

strategy:
matrix:
go: [1.18, 1.19]
os: [windows-latest, ubuntu-latest]

steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: ${{ matrix.go }}

- name: Checkout into project's git directory
uses: actions/[email protected]

- name: Get dependencies
run: go get -v -t -d ./...

- name: Build
# TODO: enable working-directory and tweak path (prepend ../../) after restructurizing the project
run: go build -ldflags="-s -w" -v -o build/haste
#working-directory: cmd/client

- name: Test
run: go test -v ./...

- name: Upload artifact
uses: actions/[email protected]
with:
name: haste-go${{ matrix.go }}-${{ matrix.os }}
path: build/haste
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
branches: [main]
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

strategy:
matrix:
go: [1.18, 1.19]

steps:
# Required for golangci/golangci-lint-action (keeping it just in case I'd like to switch back)
#- name: Set up Go
#uses: actions/[email protected]
#with:
#go-version: ${{ matrix.go }}

- name: Checkout into project's git directory
uses: actions/[email protected]

- name: Lint the code (reviewdog)
uses: reviewdog/[email protected]
with:
fail_on_error: true
go_version: ${{ matrix.go }}
filter_mode: nofilter

#- name: Lint the code
#uses: golangci/[email protected]
#with:
#version: v1.50
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode

haste
haste-client
70 changes: 70 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
linters-settings:
govet:
check-shadowing: true
revive:
min-confidence: 0
gocyclo:
min-complexity: 25
maligned:
suggest-new: true
goconst:
min-len: 2
min-occurrences: 4
gocognit:
min-complexity: 35
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- unnamedResult
- commentedOutCode
- exitAfterDefer # TODO: Investigate re-enabling this one
- filepathJoin # Disabled due to FPs in config package
- appendCombine # After a longer thought I decided I don't like this, makes code less readable
funlen:
lines: 200
statements: 50

linters:
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
# - dupl
- errcheck
- funlen
- goconst
- gocritic
# - gocyclo # same as with gocognit
- gofmt
- goimports
- revive
- gosec
- gosimple
- govet
- ineffassign
#- interfacer # archived by the owner
# - lll
# - misspell
- exportloopref
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- gocognit
# - godox
# - maligned
- prealloc

# don't enable:
# - gochecknoglobals
# - nakedret
# - gochecknoinits
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Unversioned
Loading

0 comments on commit 460db42

Please sign in to comment.