Skip to content

Commit

Permalink
Merge pull request #500 from bitcoin-sv/BUX-246/Linters
Browse files Browse the repository at this point in the history
feat(bux-246): Added linters
  • Loading branch information
Nazarii-4chain authored Apr 12, 2024
2 parents 8b7d055 + 5cc309f commit 271d217
Show file tree
Hide file tree
Showing 20 changed files with 486 additions and 595 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ bin
tmp
.all-contributorsrc
.gitpod.yml
.golangci.yml
.golangci-lint.yml
.golangci-style.yml
.goreleaser.yml
.yamllint.yml
.editorconfig
Expand Down
38 changes: 19 additions & 19 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
- color: 0075ca
- color: "0075ca"
description: "Improvements or additions to documentation"
name: "documentation"
- color: b23128
- color: "b23128"
description: "Highest rated bug or issue, affects all"
name: "bug-P1"
- color: de3d32
- color: "de3d32"
description: "Medium rated bug, affects a few"
name: "bug-P2"
- color: f44336
- color: "f44336"
description: "Lowest rated bug, affects nearly none or low-impact"
name: "bug-P3"
- color: 0e8a16
- color: "0e8a16"
description: "Any new significant addition"
name: "feature"
- color: b60205
- color: "b60205"
description: "Urgent or important fix/patch"
name: "hot-fix"
- color: cccccc
- color: "cccccc"
description: "Any idea, suggestion or opinion"
name: "idea"
- color: d4c5f9
- color: "d4c5f9"
description: "Experimental - can break!"
name: "prototype"
- color: cc317c
- color: "cc317c"
description: "Any question or concern"
name: "question"
- color: c2e0c6
- color: "c2e0c6"
description: "Unit tests, mocking, integration testing"
name: "test"
- color: fbca04
- color: "fbca04"
description: "Anything GUI related"
name: "ui-ux"
- color: 006b75
- color: "006b75"
description: "Simple updates or version bumps"
name: "chore"
- color: 006b75
- color: "006b75"
description: "Dependency updates"
name: "dependencies"
- color: 006b75
- color: "006b75"
description: "General updates"
name: "update"
- color: FFA500
- color: "FFA500"
description: "Any significant refactoring"
name: "refactor"
- color: FEF2C0
- color: "FEF2C0"
description: "Used for automatic merging"
name: "automerge"
- color: FBCA04
- color: "FBCA04"
description: "Used for denoting a WIP, stops auto-merge"
name: "work-in-progress"
- color: c2e0c6
- color: "c2e0c6"
description: "Old, unused, stale"
name: "stale"
- color: 50e061
- color: "50e061"
description: "PR was tested by a team member"
name: "tested"
40 changes: 9 additions & 31 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,55 +95,55 @@ pull_request_rules:

- name: Work in Progress
conditions:
- "head~=(?i)^wip" # if the PR branch starts with wip/
- "head~=(?i)^wip" # if the PR branch starts with wip/
actions:
label:
add: ["work-in-progress"]
- name: Hotfix label
conditions:
- "head~=(?i)^hotfix" # if the PR branch starts with hotfix/
- "head~=(?i)^hotfix" # if the PR branch starts with hotfix/
actions:
label:
add: ["hot-fix"]
- name: Bug / Fix label
conditions:
- "head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/
- "head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/
actions:
label:
add: ["bug-P3"]
- name: Documentation label
conditions:
- "head~=(?i)^docs" # if the PR branch starts with docs/
- "head~=(?i)^docs" # if the PR branch starts with docs/
actions:
label:
add: ["documentation"]
- name: Feature label
conditions:
- "head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/
- "head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/
actions:
label:
add: ["feature"]
- name: Chore label
conditions:
- "head~=(?i)^chore" # if the PR branch starts with chore/
- "head~=(?i)^chore" # if the PR branch starts with chore/
actions:
label:
add: ["update"]
- name: Question label
conditions:
- "head~=(?i)^question" # if the PR branch starts with question/
- "head~=(?i)^question" # if the PR branch starts with question/
actions:
label:
add: ["question"]
- name: Test label
conditions:
- "head~=(?i)^test" # if the PR branch starts with test/
- "head~=(?i)^test" # if the PR branch starts with test/
actions:
label:
add: ["test"]
- name: Idea label
conditions:
- "head~=(?i)^idea" # if the PR branch starts with idea/
- "head~=(?i)^idea" # if the PR branch starts with idea/
actions:
label:
add: ["idea"]
Expand Down Expand Up @@ -195,25 +195,3 @@ pull_request_rules:
- merged
actions:
delete_head_branch:

# ===============================================================================
# CONVENTION
# ===============================================================================
# https://www.conventionalcommits.org/en/v1.0.0/
# Premium feature only

#- name: Conventional Commit
# conditions:
# - "title~=^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?:"
# actions:
# post_check:
# title: |
# {% if check_succeed %}
# Title follows Conventional Commit
# {% else %}
# Title does not follow Conventional Commit
# {% endif %}
# summary: |
# {% if not check_succeed %}
# Your pull request title must follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/).
# {% endif %}
2 changes: 0 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ on:
branches:
- master
- main
# schedule:
# - cron: '0 23 * * 0'

jobs:
analyze:
Expand Down
37 changes: 30 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
push:
branches:
- "*"
# schedule:
# - cron: '1 4 * * *'

jobs:
yamllint:
Expand Down Expand Up @@ -40,6 +38,34 @@ jobs:
- name: Ask Nancy
uses: sonatype-nexus-community/[email protected]
continue-on-error: true
error-lint:
name: error-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --config=./.golangci-lint.yml
style-lint:
name: style-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: golangci-style-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --config=./.golangci-style.yml
test:
needs: [yamllint, asknancy]
strategy:
Expand Down Expand Up @@ -68,9 +94,6 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run linter
run: make lint
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
- name: Run tests
Expand All @@ -80,5 +103,5 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
Loading

0 comments on commit 271d217

Please sign in to comment.