-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mojtaba/reduce-bittwister-tests
- Loading branch information
Showing
69 changed files
with
1,397 additions
and
1,486 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 |
---|---|---|
|
@@ -7,9 +7,10 @@ on: | |
types: [opened, ready_for_review] | ||
|
||
jobs: | ||
issue-management: | ||
if: ${{ github.event.issue }} | ||
name: Add issues to project and add triage label | ||
add-to-project-with-knuu-label: | ||
# ignore dependabot PRs | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
name: Add issues and PRs to project and add knuu label | ||
uses: celestiaorg/.github/.github/workflows/[email protected] | ||
secrets: inherit | ||
permissions: | ||
|
@@ -21,20 +22,6 @@ jobs: | |
run-projects: true | ||
project-url: https://github.com/orgs/celestiaorg/projects/27 | ||
|
||
add-pr-to-project: | ||
# ignore dependabot PRs | ||
if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} | ||
name: Add PRs to project | ||
uses: celestiaorg/.github/.github/workflows/[email protected] | ||
secrets: inherit | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
with: | ||
run-projects: true | ||
project-labels: "knuu" | ||
project-url: https://github.com/orgs/celestiaorg/projects/27 | ||
|
||
auto-add-reviewer: | ||
name: Auto add reviewer to PR | ||
if: github.event.pull_request | ||
|
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
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,55 @@ | ||
name: Lint | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
merge_group: | ||
|
||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22.1 | ||
# This steps sets the GIT_DIFF environment variable to true | ||
# if files defined in PATTERS changed | ||
- uses: technote-space/[email protected] | ||
with: | ||
# This job will pass without running if go.mod, go.sum, and *.go | ||
# wasn't modified. | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
args: --timeout 10m | ||
github-token: ${{ secrets.github_token }} | ||
if: env.GIT_DIFF | ||
|
||
yamllint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: celestiaorg/.github/.github/actions/[email protected] | ||
|
||
markdown-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: celestiaorg/.github/.github/actions/[email protected] | ||
|
||
govulncheck: | ||
runs-on: ubuntu-latest | ||
name: Run govulncheck | ||
steps: | ||
- id: govulncheck | ||
uses: golang/govulncheck-action@v1 | ||
with: | ||
go-version-input: 1.22.1 | ||
go-package: ./... |
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,4 @@ | ||
coverage.txt | ||
.vscode/launch.json | ||
*/**.html | ||
*.idea |
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,46 @@ | ||
run: | ||
timeout: 5m | ||
modules-download-mode: readonly | ||
|
||
linters: | ||
disable: | ||
# TODO: there are tons of errors for these, we need to handle in a separate PR | ||
- errorlint | ||
- errcheck | ||
- gosec | ||
enable: | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- revive | ||
- staticcheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
|
||
issues: | ||
exclude-use-default: false | ||
include: | ||
- EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments | ||
- EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments | ||
exclude: | ||
- SA1019 # TODO enable: SA 1019 staticcheck: this is being triggered by the refactor and all the deprecated code. We need to enable this once we make the breaking change official | ||
|
||
linters-settings: | ||
revive: | ||
rules: | ||
- name: package-comments | ||
disabled: true | ||
- name: duplicated-imports | ||
severity: warning | ||
- name: exported | ||
disabled: true | ||
# Leaving for reference if we can enable in the future. | ||
# arguments: | ||
# - disableStutteringCheck | ||
|
||
goimports: | ||
local-prefixes: github.com/celestiaorg |
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,6 @@ | ||
default: true | ||
MD010: false | ||
MD013: false | ||
MD041: false | ||
MD024: | ||
allow_different_nesting: true |
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,9 @@ | ||
--- | ||
# Built from docs https://yamllint.readthedocs.io/en/stable/configuration.html | ||
extends: default | ||
|
||
rules: | ||
# 120 chars should be enough, but don't fail if a line is longer | ||
line-length: | ||
max: 120 | ||
level: warning |
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
File renamed without changes.
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 |
---|---|---|
@@ -1,7 +1,64 @@ | ||
pkgs := $(shell go list ./...) | ||
run := . | ||
count := 1 | ||
timeout := 120m | ||
|
||
test: | ||
KNUU_TIMEOUT=120m go test -v $(pkgs) -run $(run) -count=$(count) -timeout 120m | ||
## help: Show this help message | ||
help: Makefile | ||
@echo " Choose a command run in "$(PROJECTNAME)":" | ||
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' | ||
.PHONY: help | ||
|
||
## clean: clean testcache | ||
clean: | ||
@echo "--> Clearing testcache" | ||
@go clean --testcache | ||
@rm coverage.txt | ||
.PHONY: clean | ||
|
||
## cover: generate to code coverage report. | ||
cover: | ||
@echo "--> Generating Code Coverage" | ||
@go install github.com/ory/go-acc@latest | ||
@go-acc -o coverage.txt $(pkgs) | ||
.PHONY: cover | ||
|
||
## deps: Install dependencies | ||
deps: | ||
@echo "--> Installing dependencies" | ||
@go mod download | ||
@go mod tidy | ||
.PHONY: deps | ||
|
||
## lint: Run linters golangci-lint and markdownlint. | ||
lint: vet | ||
@echo "--> Running markdownlint" | ||
@markdownlint --config .markdownlint.yaml '**/*.md' | ||
@echo "--> Running yamllint" | ||
@yamllint --no-warnings . -c .yamllint.yml | ||
@echo "--> Running actionlint" | ||
@actionlint | ||
@echo "--> Running govulncheck" | ||
@govulncheck ./... | ||
@echo "--> Running golangci-lint" | ||
@golangci-lint run | ||
.PHONY: lint | ||
|
||
## fmt: Run fixes for linters. | ||
fmt: | ||
@echo "--> Formatting markdownlint" | ||
@markdownlint --config .markdownlint.yaml '**/*.md' -f | ||
@echo "--> Formatting go" | ||
@golangci-lint run --fix | ||
.PHONY: fmt | ||
|
||
## vet: Run go vet | ||
vet: | ||
@echo "--> Running go vet" | ||
@go vet $(pkgs) | ||
.PHONY: vet | ||
|
||
## test: Run the testsuite | ||
test: vet | ||
go test -v $(pkgs) -run $(run) -count=$(count) -timeout $(timeout) | ||
.PHONY: test |
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
Oops, something went wrong.