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

Debug golangci-lint #5988

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build-ui-and-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: golangci/golangci-lint-action@v3.2.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
version: v1.47.3

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down Expand Up @@ -337,4 +337,3 @@ jobs:
cd docs
bundle install
bundle exec rake graphql:compile_docs

5 changes: 2 additions & 3 deletions .github/workflows/mesheryctl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: golangci/golangci-lint-action@v3.2.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
version: v1.47.3
# Optional: working directory, useful for monorepos
working-directory: mesheryctl

Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
check-latest: "true"
- name: Run script 📜
run: |
cd mesheryctl/doc
cd mesheryctl/doc
go run doc.go
- name: Commit ✅
uses: stefanzweifel/git-auto-commit-action@v4
Expand All @@ -105,4 +105,3 @@ jobs:
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: "--signoff"
commit_message: "[Docs] Update mesheryctl docs"

10 changes: 2 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ linters-settings:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
checks:
- argument
- case
- condition
Expand Down Expand Up @@ -150,10 +150,4 @@ run:
- internal/renameio
- internal/robustio
timeout: 5m

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.45.2 # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
go: '1.17'
1 change: 1 addition & 0 deletions helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func MergeStringMaps(maps ...map[string]string) map[string]string {
}

func ResolveFSRef(path string) (string, error) {
// other useless comment
return utils.ReadFileSource(fmt.Sprintf("file://%s", path))
}

Expand Down
1 change: 0 additions & 1 deletion mesheryctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ RELEASE_CHANNEL="edge"
LDFLAGS="-w -s -X github.com/layer5io/meshery/mesheryctl/internal/cli/root/constants.version=${GIT_VERSION} -X github.com/layer5io/meshery/mesheryctl/internal/cli/root/constants.commitsha=${GIT_COMMITSHA} -X github.com/layer5io/meshery/mesheryctl/internal/cli/root/constants.releasechannel=${RELEASE_CHANNEL}"

make:
gofmt -l -s -w .
go build -ldflags=${LDFLAGS} -o mesheryctl cmd/mesheryctl/main.go
forwin:
go build -ldflags=${LDFLAGS} -o mesheryctl.exe cmd/mesheryctl/main.go
Expand Down
1 change: 1 addition & 0 deletions mesheryctl/pkg/utils/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Provider struct {
// NewRequest creates *http.Request and handles adding authentication for Meshery itself
// Function returns a http response generated by the new request
func NewRequest(method string, url string, body io.Reader) (*http.Request, error) {
// useless comment
// create new request
req, err := http.NewRequest(method, url, body)
if err != nil {
Expand Down