-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Setup lint and format of Go, Proto and yaml/markdown #223
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
6b3114a
Run prettier
kradalby edfcdc4
Update lint ci file with prettier and proto
kradalby 03b7ec6
Go format with shorter lines
kradalby dae34ca
Proto format
kradalby 2634215
golangci-lint --fix
kradalby 3ddd996
Add format make entry
kradalby 148437f
Setup more linters and goals for golangci
kradalby 24e0c94
Align with update golangci-lint
kradalby 95b9f03
update buf setup
kradalby fa0922d
define proto dir for buf
kradalby b653572
Make format shuld format, not lint
kradalby 806f0d3
Format lint
kradalby f94b0b5
Remove lint install, update go
kradalby e8726b1
Add readme note about codestyle
kradalby f3da299
Format readme
kradalby 052883a
Fix merge conflict
kradalby 1969802
Fix golanglint
kradalby d0ef850
Add and fix noctx linter
kradalby 89eb13c
Add and fix nlreturn (new line return)
kradalby 4ace54c
Move wsl, might not be feasible
kradalby 668e958
Add and fix unconvert
kradalby 0315f55
Add and fix nilnil
kradalby 19cd7a4
Add and fix exhaustive
kradalby c9c16c7
Remove unused params or returns
kradalby 9390348
Add and fix goconst
kradalby 796072a
Add and fix ifshort
kradalby 85f28a3
Remove all instances of undefined numbers (gonmd)
kradalby ba084b9
Lint fix integration tests
kradalby 53ed749
Start work on making gocritic pass
kradalby 471c0b4
Initial work eliminating one/two letter variables
kradalby 333be80
Fix rest of var name in main code
kradalby 8ae682b
Fix var name length in tests
kradalby 78cfba0
Add exceptions to var name length
kradalby 2dde124
Fix formatting
kradalby 0c45f8d
Add and fix errorlint
kradalby 0c005a6
Add and fix errname
kradalby 715542a
Add and fix stylecheck (golint replacement)
kradalby c4d4c9c
Add and fix gosec
kradalby db8be91
Add and fix forbidigo
kradalby 25b790d
Add and fix forcetypeassert
kradalby d673938
Get rid of dynamic errors
kradalby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
--- | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
# The "build" workflow | ||
lint: | ||
# The type of runner that the job will run on | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: latest | ||
args: --timeout 30m | ||
|
||
prettier-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Install and run golangci-lint as a separate step, it's much faster this | ||
# way because this action has caching. It'll get run again in `make lint` | ||
# below, but it's still much faster in the end than installing | ||
# golangci-lint manually in the `Run lint` step. | ||
- uses: golangci/golangci-lint-action@v2 | ||
- name: Prettify code | ||
uses: creyD/[email protected] | ||
with: | ||
prettier_options: >- | ||
--check **/*.{ts,js,md,yaml,yml,sass,css,scss,html} | ||
only_changed: false | ||
dry: true | ||
|
||
proto-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: bufbuild/[email protected] | ||
- uses: bufbuild/buf-lint-action@v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the standard gofmt config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean in general, not just this line...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, its gofumpt,which I think is standard in vscode, and then it is run through golines to break long lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added note in readme.