Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bux-246): Added linters #500

Merged
merged 34 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9ace3ed
feat(bux-246): Added linters
Nazarii-4chain Mar 12, 2024
42f46de
feat(bux-246): Changed path
Nazarii-4chain Mar 12, 2024
54e3487
feat(bux-246): Changed path
Nazarii-4chain Mar 12, 2024
d9cadb3
feat(bux-246): Changed path
Nazarii-4chain Mar 12, 2024
ac96787
Merge branch 'master' into BUX-246/Linters
arkadiuszos4chain Mar 13, 2024
6821845
feat(bux-246): Added linter settings
Nazarii-4chain Mar 14, 2024
e25f065
Merge branch 'master' of https://github.com/bitcoin-sv/spv-wallet int…
Nazarii-4chain Mar 14, 2024
9571594
Merge branch 'BUX-246/Linters' of https://github.com/bitcoin-sv/spv-w…
Nazarii-4chain Mar 14, 2024
aeedfcb
Merge branch 'master' into BUX-246/Linters
Nazarii-4chain Mar 29, 2024
01dab20
Merge branch 'master' of https://github.com/bitcoin-sv/spv-wallet int…
Nazarii-4chain Apr 4, 2024
014777e
feat(bux-246): Changed linters list
Nazarii-4chain Apr 4, 2024
602c830
feat(bux-246): Changed jobs names
Nazarii-4chain Apr 4, 2024
a40ff87
feat(bux-246): Changed presets
Nazarii-4chain Apr 4, 2024
08a7111
feat(bux-246): Changed presets
Nazarii-4chain Apr 4, 2024
6cead18
Merge branch 'master' of https://github.com/bitcoin-sv/spv-wallet int…
Nazarii-4chain Apr 4, 2024
879aadc
feat(bux-246): go vet fixes
Nazarii-4chain Apr 4, 2024
ada8b82
feat(bux-246): go vet fixes
Nazarii-4chain Apr 4, 2024
1573c35
feat(bux-246): go vet fixes
Nazarii-4chain Apr 4, 2024
a338b4b
feat(bux-246): go vet fixes
Nazarii-4chain Apr 4, 2024
60f49e1
feat(bux-246): optimize structs
Nazarii-4chain Apr 4, 2024
66ac26e
feat(bux-246): optimize structs
Nazarii-4chain Apr 5, 2024
d804335
Merge branch 'master' of https://github.com/bitcoin-sv/spv-wallet int…
Nazarii-4chain Apr 5, 2024
beb472a
Merge branch 'master' of https://github.com/bitcoin-sv/spv-wallet int…
Nazarii-4chain Apr 5, 2024
d30afa4
Merge branch 'master' into BUX-246/Linters
Nazarii-4chain Apr 8, 2024
82b3bcf
feat(bux-685): Changed workflows, changed makefile
Nazarii-4chain Apr 9, 2024
b434f03
feat(bux-685): Removed unused files
Nazarii-4chain Apr 9, 2024
766f7cb
Merge branch 'master' into BUX-246/Linters
Nazarii-4chain Apr 9, 2024
5a4b881
feat(bux-246): removed deprecated options
Nazarii-4chain Apr 10, 2024
ea6e0aa
Merge branch 'master' of https://github.com/bitcoin-sv/spv-wallet int…
Nazarii-4chain Apr 10, 2024
749e3c3
feat(bux-246): changed prefix
Nazarii-4chain Apr 10, 2024
f797559
feat(bux-246): yamllint fixes
Nazarii-4chain Apr 10, 2024
f928afb
feat(bux-246): merge main, updated links
Nazarii-4chain Apr 11, 2024
29dd5dd
feat(bux-246): changed yamllint config
Nazarii-4chain Apr 12, 2024
5cc309f
Merge branch 'main' into BUX-246/Linters
Nazarii-4chain Apr 12, 2024
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
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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Basic dependabot.yml to update gomod, Github Actions and Docker
version: 2
updates:
Expand Down
39 changes: 20 additions & 19 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
- 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"
41 changes: 10 additions & 31 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
pull_request_rules:

# ===============================================================================
Expand Down Expand Up @@ -95,55 +96,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 +196,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 %}
5 changes: 2 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
on: # yamllint disable-line rule:truthy
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
# schedule:
# - cron: '0 23 * * 0'

jobs:
analyze:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "On pull request"

on:
on: # yamllint disable-line rule:truthy
pull_request_target:
types:
- labeled
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
name: Release
permissions:
contents: write
packages: write

env:
GO111MODULE: on
GO111MODULE: on # yamllint disable-line rule:truthy

on:
on: # yamllint disable-line rule:truthy
push:
tags:
- 'v*'
Expand Down
42 changes: 33 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
# See more at: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: run-go-tests

env:
GO111MODULE: on
GO111MODULE: "on"

on:
"on":
pull_request:
branches:
- "*"
push:
branches:
- "*"
# schedule:
# - cron: '1 4 * * *'

jobs:
yamllint:
Expand Down Expand Up @@ -40,6 +39,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 +95,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 +104,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)
3 changes: 2 additions & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
# Workflow: https://github.com/micnncim/action-label-syncer
# Export your labels: https://github.com/micnncim/label-exporter
name: sync-labels
on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
tasks:
- init: go get && go build ./...
command: go run
Loading
Loading