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

Add CI Linting step #2914

Closed
wants to merge 16 commits into from
39 changes: 39 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: golangci-lint
'on':
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
- edited

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20.x'
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

# Show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true

# Command line arguments
args: --timeout 5m --enable-all
8 changes: 6 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ linters-settings:
- (*github.com/ActiveState/termtest.ConsoleProcess).Expect
- (*github.com/ActiveState/termtest.ConsoleProcess).WaitForInput

# When issues occur with linting us the snippet below to help with debugging
linters:
enable-all: true

# When issues occur with linting use the snippet below to help with debugging
# Make sure to disable the other linters block first
# linters:
# # Disable all and re-enable the default linters as a starting point.
# disable-all: true
Expand All @@ -23,4 +27,4 @@ linters-settings:
# - ineffassign
# - staticcheck
# - typecheck
# - unused
# - unused
6 changes: 3 additions & 3 deletions internal/runbits/requirements/requirements.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package requirements

import (
"fmt"
"strconv"
"strings"

"github.com/ActiveState/cli/internal/analytics"
anaConsts "github.com/ActiveState/cli/internal/analytics/constants"
"github.com/ActiveState/cli/internal/captain"
"github.com/ActiveState/cli/internal/config"
"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/logging"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/multilog"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/primer"
"github.com/ActiveState/cli/internal/prompt"
"github.com/ActiveState/cli/internal/rtutils/ptr"
"github.com/ActiveState/cli/internal/runbits"
"fmt"
"github.com/ActiveState/cli/internal/runbits/commitmediator"
"github.com/ActiveState/cli/internal/runbits/rationalize"
bpModel "github.com/ActiveState/cli/pkg/platform/api/buildplanner/model"
Expand Down
Loading