Skip to content

Commit

Permalink
add: new workflows and golangci
Browse files Browse the repository at this point in the history
  • Loading branch information
KarolosLykos committed Jan 17, 2022
1 parent d705897 commit 4cc1fe9
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Bug report
about: Create a bug report to help us improve
title: ''
labels: bug
assignees: ''

---

9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Feature request
about: "Suggest an idea for this project"
title: ''
labels: proposal
assignees: ''

---

20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Description
Describe your work here.

### Scope
> What is affected by this pull request?
- [ ] Bug Fix
- [ ] New Feature
- [ ] Documentation
- [ ] Other

### Related Issue
Fixes #


### To-Do Checklist
- [ ] I tested my changes
- [ ] I have commented every method that I created/changed
- [ ] I updated the examples to fit with my changes
- [ ] I have added tests for my newly created methods
10 changes: 10 additions & 0 deletions .github/workflows/conventional-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

on:
pull_request_target:
types: [ opened, edited ]
name: conventional-release-labels
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/conventional-release-labels@v1
13 changes: 13 additions & 0 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: golangci-lint
on: [ push, pull_request ]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.43
79 changes: 79 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
linters-settings:
goimports:
local-prefixes: github.com/KarolosLykos/cli-template
gocyclo:
min-complexity: 15
govet:
check-shadowing: true
stylecheck:
checks: ["all", "-ST1006"]
misspell:
locale: US,UK
nolintlint:
allow-leading-space: false # require machine-readable nolint directives (with no leading space)
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

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- bodyclose
- depguard
- dupl
- exportloopref
- forcetypeassert
- funlen
- gci
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- gofumpt
- gomnd
- goprintffuncname
- gosec
- ifshort
- misspell
- noctx
- nolintlint
- rowserrcheck
- sqlclosecheck
- stylecheck
- thelper
- tparallel
- unconvert
- unparam
- whitespace
# - errorlint
# - goerr113
# - wrapcheck
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- gocritic
- linters:
- gocritic
text: "unnecessaryDefer:"

service:
golangci-lint-version: 1.43.x # use the fixed version to not introduce new linters unexpectedly
3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/spf13/cobra"
)

// dateCmd command to print the date.
var rootCmd = &cobra.Command{
Use: "cli-template",
Short: "This cli template shows nothing",
Expand All @@ -16,6 +17,8 @@ var rootCmd = &cobra.Command{
Version: "v0.0.1", // <--VERSION-->
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
Expand Down

0 comments on commit 4cc1fe9

Please sign in to comment.