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

Improve CONTRIBUTING.md and update Makefile help message #1820

Open
maxRN opened this issue Oct 4, 2022 · 1 comment · May be fixed by #1823
Open

Improve CONTRIBUTING.md and update Makefile help message #1820

maxRN opened this issue Oct 4, 2022 · 1 comment · May be fixed by #1823
Labels
kind/documentation Documentation of cobra itself

Comments

@maxRN
Copy link

maxRN commented Oct 4, 2022

Hi 👋🏼

The CONTRIBUTING.md file doesn't mention the requirements (golangci-lint and richgo), we should add those for a smoother experience.

And while we are on that, when I tried to run make test the first time, this is what it looked like:

Makefile:5: "could not find golangci-lint in /opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/libiconv/bin:/Users/maxrn/.pyenv/shims:/Users/maxrn/.nvm/versions/node/v16.13.0/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/maxrn/.sdkman/candidates/java/current/bin:/opt/homebrew/opt/llvm/bin:/Users/maxrn/.cabal/bin:/Users/maxrn/.ghcup/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/libiconv/bin:/Users/maxrn/.nvm/versions/node/v16.13.0/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/maxrn/.cargo/bin:/opt/homebrew/opt/fzf/bin:/Users/maxrn/go/bin:/Users/maxrn/src/sonar-scanner-4.7.0.2747-macosx/bin:/Users/maxrn/.dotfiles/bin:/Users/maxrn/go/bin:/Users/maxrn/src/sonar-scanner-4.7.0.2747-macosx/bin:/Users/maxrn/.dotfiles/bin, run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh"
Makefile:9: "could not find richgo in /opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/libiconv/bin:/Users/maxrn/.pyenv/shims:/Users/maxrn/.nvm/versions/node/v16.13.0/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/maxrn/.sdkman/candidates/java/current/bin:/opt/homebrew/opt/llvm/bin:/Users/maxrn/.cabal/bin:/Users/maxrn/.ghcup/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/libiconv/bin:/Users/maxrn/.nvm/versions/node/v16.13.0/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/maxrn/.cargo/bin:/opt/homebrew/opt/fzf/bin:/Users/maxrn/go/bin:/Users/maxrn/src/sonar-scanner-4.7.0.2747-macosx/bin:/Users/maxrn/.dotfiles/bin:/Users/maxrn/go/bin:/Users/maxrn/src/sonar-scanner-4.7.0.2747-macosx/bin:/Users/maxrn/.dotfiles/bin, run: go install github.com/kyoh86/richgo@latest"
******************** downloading dependencies ********************
go get -v ./...
******************** running tests ********************
richgo test -v ./...
make: richgo: No such file or directory
make: *** [test] Error 1

We are printing the entire PATH variable which is pointless IMO. It makes it hard to parse the actual error and the help message ((warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh")) is also easily glossed over. I would propose not printing the value of $PATH but just "$PATH". This makes clear the error and also helps the user see the help message more easily.

On that note, the link for installing golangci-lint is outdated. According to the documentation the recommended way for Mac is using brew and the curl command is now curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0

@johnSchnake johnSchnake added the kind/documentation Documentation of cobra itself label Nov 30, 2022
@github-actions
Copy link

github-actions bot commented Feb 1, 2023

The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the issue is closed.
    You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If an issue has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interested in reopening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Documentation of cobra itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants