Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
24 changes: 9 additions & 15 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,26 @@ jobs:
runs-on: ubuntu-latest
name: Update coverage badge
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.18'
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/cache@v3
uses: actions/checkout@v6
- name: Setup go
uses: actions/setup-go@v6
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: stable
cache: true

- name: Run Test
run: |
go test -v ./... -covermode=count -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out

- name: Go Coverage Badge # Pass the `coverage.out` output to this action
uses: tj-actions/coverage-badge-go@v2
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v3
with:
filename: coverage.out

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: README.md
Expand All @@ -51,7 +45,7 @@ jobs:

- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
uses: ad-m/github-push-action@v1
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Tagged Release
runs-on: ubuntu-latest
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
- uses: actions/checkout@v6
- uses: softprops/action-gh-release@v3
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
generate_release_notes: true
18 changes: 9 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: '^1.16'
- name: Checkout repository
uses: actions/checkout@v3
go-version: stable
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3.3.1
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --verbose
test:
needs: lint
strategy:
matrix:
go: [1.16, 1.17, 1.18, 1.19]
go: ["1.21", "1.22", "1.23", "1.24", "1.25", "1.26"]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Checkout Code
uses: actions/checkout@v3
- name: Run Tests
run: go test -v ./...
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### Go template
# 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

# 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/

# Go workspace file
go.work
go.work.sum

# env file
.env

150 changes: 86 additions & 64 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,109 @@
version: "2"

run:
deadline: 5m
timeout: 5m

linters-settings:
errcheck:
check-type-assertions: true
check-blank: false
govet:
check-shadowing: true
gci:
sections:
- standard
- default
- prefix( github.com/behzadsh/go.localization)
- blank
- dot
godot:
capital: true
gofumpt:
extra-rules: true
revive:
enable-all-rules: true
rules:
- name: add-constant
disabled: true
- name: argument-limit
disabled: true
- name: banned-characters
disabled: true
- name: cognitive-complexity
disabled: true
- name: cyclomatic
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: function-result-limit
arguments: [2]
- name: line-length-limit
disabled: false
arguments: [120]
- name: max-public-structs
disabled: true
- name: package-comments
disabled: true
- name: unhandled-error
arguments:
- "fmt.Printf"
- "fmt.Println"
- "fmt.Print"
misspell:
locale: US
ignore-words:
- behzadsh
nolintlint:
require-explanation: true
require-specific: true
gocyclo:
min-complexity: 15
gocognit:
min-complexity: 15
formatters:
enable:
- gci
- gofumpt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/behzadsh/go.localization)
- blank
- dot

linters:
enable-all: false
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- errname
- gci
- gocyclo
- gocognit
- godot
- gofumpt
- gosec
- revive
- misspell
- prealloc
- unconvert
- nolintlint
exclusions:
rules:
- path: "_test\\.go$"
linters:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- errname
- gocyclo
- gocognit
- godot
- gosec
- revive
- misspell
- prealloc
- unconvert
- nolintlint
settings:
errcheck:
check-type-assertions: true
check-blank: false
govet:
enable:
- shadow
godot:
capital: true
revive:
enable-all-rules: true
rules:
- name: add-constant
disabled: true
- name: argument-limit
disabled: true
- name: banned-characters
disabled: true
- name: cognitive-complexity
disabled: true
- name: cyclomatic
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: function-result-limit
arguments: [2]
- name: line-length-limit
disabled: false
arguments: [120]
- name: max-public-structs
disabled: true
- name: package-comments
disabled: true
- name: unhandled-error
arguments:
- "fmt.Printf"
- "fmt.Println"
- "fmt.Print"
misspell:
locale: US
ignore-words:
- behzadsh
nolintlint:
require-explanation: true
require-specific: true
gocyclo:
min-complexity: 15
gocognit:
min-complexity: 15

issues:
exclude-use-default: false
exclude-default-rules: false
Loading
Loading