generated from keploy/template
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: shivamsouravjha <[email protected]>
- Loading branch information
1 parent
aa83b4a
commit ecd2bf1
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This is the configuration for golangci-lint for the restic project. | ||
# | ||
# A sample config with all settings is here: | ||
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml | ||
|
||
linters: | ||
# only enable the linters listed below | ||
disable-all: true | ||
enable: | ||
# make sure all errors returned by functions are handled | ||
- errcheck | ||
|
||
# find unused code | ||
- deadcode | ||
|
||
# show how code can be simplified | ||
- gosimple | ||
|
||
# # make sure code is formatted | ||
- gofmt | ||
|
||
# examine code and report suspicious constructs, such as Printf calls whose | ||
# arguments do not align with the format string | ||
- govet | ||
|
||
# make sure names and comments are used according to the conventions | ||
- revive | ||
|
||
# detect when assignments to existing variables are not used | ||
- ineffassign | ||
|
||
# run static analysis and find errors | ||
- staticcheck | ||
|
||
# find unused variables, functions, structs, types, etc. | ||
- unused | ||
|
||
# find unused struct fields | ||
- structcheck | ||
|
||
# find unused global variables | ||
- varcheck | ||
|
||
# parse and typecheck code | ||
- typecheck | ||
|
||
issues: | ||
# don't use the default exclude rules, this hides (among others) ignored | ||
# errors from Close() calls | ||
exclude-use-default: false | ||
|
||
# list of things to not warn about | ||
exclude: | ||
# revive: do not warn about missing comments for exported stuff | ||
- exported (function|method|var|type|const) .* should have comment or be unexported | ||
# revive: ignore constants in all caps | ||
- don't use ALL_CAPS in Go names; use CamelCase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
pull-requests: read | ||
|
||
# cancel the in-progress workflow when PR is refreshed. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: false | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Require: The version of golangci-lint to use. | ||
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. | ||
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. | ||
version: v1.54 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
only-new-issues: true | ||
|
||
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. | ||
install-mode: "goinstall" |