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 some code quality tools and CI automation #14

Open
4 tasks
egregors opened this issue Oct 27, 2019 · 0 comments
Open
4 tasks

Add some code quality tools and CI automation #14

egregors opened this issue Oct 27, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@egregors
Copy link
Contributor

To make the project more pretty for contributing and easy for PR management we should make a few things:

  • add gofmt and golint into Makefile
  • add pre-commit hooks with formating code and linting
  • add GitHub Action with the install, build, lint, test steps for all PR's
  • add GitHub Action for automating upload new version into brew

gofmt – std tool for formatting source code, running it before commits are dramatically good practice.

golint – the same, but for linting. This tool usually helps write code more idiomatically

even now (with really small code base) golint suggest many improvements:

➜  underblog git:(master) ✗ golint ./app/...
app/cmd/blog.go:18:7: exported const DefaultMarkdownPath should have comment or be unexported
app/cmd/blog.go:20:1: comment on exported function NewBlog should be of the form "NewBlog ..."
app/cmd/blog.go:71:13: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
app/cmd/blog.go:77:13: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
app/cmd/blog.go:130:16: method copyCssToPublicDir should be copyCSSToPublicDir
app/cmd/post.go:17:1: exported function NewPost should have comment or be unexported
app/cmd/post.go:62:6: exported type Post should have comment or be unexported
app/cmd/underblog.go:9:1: exported function MakeBlog should have comment or be unexported
app/cmd/underblog.go:14:10: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
app/internal/cli.go:7:6: exported type Opts should have comment or be unexported

@freetonik are the GitHub actions available for this repo? Only owner or collaborator may figure it out

@freetonik freetonik added the enhancement New feature or request label Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants