Skip to content

Commit

Permalink
Added templates
Browse files Browse the repository at this point in the history
  • Loading branch information
KostLinux committed May 28, 2024
1 parent e4af690 commit 4db1522
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Bug report
about: Create a report to help us improve
title: "[BUG] YOUR_TITLE"
labels: bug
assignees: 'KostLinux'
assignees: ''

---

Expand All @@ -30,4 +30,4 @@ If applicable, add screenshots to help explain your problem.
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Feature request
about: Suggest an idea for this project
title: "[FEATURE] YOUR_TITLE"
labels: enhancement
assignees: 'KostLinux'
assignees: ''

---

Expand All @@ -17,4 +17,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/hotfix-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Hotfix issue template
about: Describe this issue template's purpose here.
title: "[HOTFIX] YOUR_TITLE"
labels: hotfix
assignees: ''

---

**Describe the bug**
A clear and concise description of what to fix.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Device (please complete the following information):**
- Device: [e.g. Mac, iPhone]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
13 changes: 9 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Basic set up for three package managers
version: 2
updates:
# Maintain dependencies for Composer
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
directory: "./"
reviewers:
- "KostLinux"
- "KostLinux"
schedule:
interval: "weekly"
commit-message:
prefix: '[Go Modules]'
include: scope
61 changes: 61 additions & 0 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
run:
# Default concurrency is an available CPU number
concurrency: 4

# Timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 5m

# Include test files or not, default is true
tests: true

# Settings of specific linters
linters-settings:
gocyclo:
min-complexity: 20

linters:
# do not use `enable-all`: it's deprecated and will be removed soon.
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- dogsled
- durationcheck
- errcheck
- errchkjson
- execinquery
- exportloopref
- forbidigo
- gocognit
- goconst
- gocritic
- godox
- gofmt
- gofumpt
- goimports
- goprintffuncname
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nestif
- nilerr
- nonamedreturns
- prealloc
- predeclared
- revive
- staticcheck
- stylecheck
- tenv
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace

issues:
max-same-issues: 0
40 changes: 40 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Dependencies

- Dependency 1
- Dependency 2

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Some Feature Test A ( for example - API Request against third party API point )
- [ ] Some Feature Test B ( for example - API Data Response Check via Postman / Curl )

**Test Configuration**:
* Device:
* Tools (optional):
* SDK (optional):

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas (optional)
- [ ] I have made corresponding changes to the documentation (optional)
- [ ] My changes generate no new warnings
- [ ] I've performed/added tests/lints that prove my fix is effective or that my feature works (optional)

Before creating pull request, look that all points under checklist are done!
64 changes: 64 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build
on:
pull_request:
types:
- opened
- edited
- closed
branches:
- main

permissions:
contents: read
packages: read
statuses: write
pull-requests: write

jobs:
read_changes:
runs-on: ubuntu-latest
outputs:
go: ${{ steps.changes.outputs.go }}
src: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
go:
- 'main.go'
- 'go.mod'
- 'controller/**'
- 'middleware/**'
- 'model/**'
- 'repository/**'
- 'service/**'
src:
- '.github/**'
- 'doc/**'
golangci:
needs: read_changes
if: needs.read_changes.outputs.go == 'true'
name: Lint Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: ./
args: --timeout=30m --config=./.golangci.yml --issues-exit-code=0
only-new-issues: true
skip-cache: true
skip-pkg-cache: true

0 comments on commit 4db1522

Please sign in to comment.