Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use golangci-lint instead of golint#778

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
per1234 wants to merge1 commit intoarduino:main
base:main
Choose a base branch
Loading
fromper1234:golangci-lint
Open
Show file tree
Hide file tree
Changes fromall 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
45 changes: 6 additions & 39 deletions.github/workflows/check-go-task.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,13 +12,15 @@ on:
paths:
- ".github/workflows/check-go-task.ya?ml"
- "Taskfile.ya?ml"
- ".golangci.ya?ml"
- "**/go.mod"
- "**/go.sum"
- "**.go"
pull_request:
paths:
- ".github/workflows/check-go-task.ya?ml"
- "Taskfile.ya?ml"
- ".golangci.ya?ml"
- "**/go.mod"
- "**/go.sum"
- "**.go"
Expand DownExpand Up@@ -53,43 +55,6 @@ jobs:

echo "result=$RESULT" >> $GITHUB_OUTPUT

check-errors:
name: check-errors (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
module:
- path: ./
- path: docsgen
- path: ruledocsgen

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check for errors
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task go:vet

check-outdated:
name: check-outdated (${{ matrix.module.path }})
needs: run-determination
Expand DownExpand Up@@ -162,8 +127,10 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install golint
run: go install golang.org/x/lint/golint@latest
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54

- name: Check style
env:
Expand Down
7 changes: 7 additions & 0 deletions.golangci.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go/.golangci.yml
# See: https://golangci-lint.run/usage/configuration/
issues:
exclude-use-default: false
linters:
enable:
- revive
24 changes: 4 additions & 20 deletionsTaskfile.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,13 +56,6 @@ tasks:
vars:
GO_MODULE_PATH: ./ruledocsgen
- task: go:test-integration
- task: go:vet
- task: go:vet
vars:
GO_MODULE_PATH: ./docsgen
- task: go:vet
vars:
GO_MODULE_PATH: ./ruledocsgen
- task: go:lint
- task: go:lint
vars:
Expand DownExpand Up@@ -250,14 +243,12 @@ tasks:
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
cmds:
- |
if ! which golint &>/dev/null; then
echo "golint not installed or not in PATH. Please install: https://github.com/golang/lint#installation"
if ! which golangci-lint &>/dev/null; then
echo "golangci-lint not installed or not in PATH."
echo "Please install: https://golangci-lint.run/usage/install/#local-installation"
exit 1
fi
- |
golint \
{{default "-min_confidence 0.8 -set_exit_status" .GO_LINT_FLAGS}} \
{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
- golangci-lint run

go:rule-docs:
desc: Generate rules documentation
Expand DownExpand Up@@ -308,13 +299,6 @@ tasks:
cmds:
- go mod tidy -compat={{.GO_VERSION}}

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
go:vet:
desc: Check for errors in Go code
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
cmds:
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
markdown:check-links:
desc: Check for broken links
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp