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

chore: turbo lint #368

Merged
merged 12 commits into from
Mar 30, 2023
Merged

chore: turbo lint #368

merged 12 commits into from
Mar 30, 2023

Conversation

aljo242
Copy link

@aljo242 aljo242 commented Mar 29, 2023

Linter rules have been expanded a lot to ensure a more uniform codebase:

enable:
    # Check for pass []any as any in variadic func(...any).
      # Rare case but saved me from debugging a few times.
    - asasalint
    # I prefer plane ASCII identifiers.
    # Symbol `∆` instead of `delta` looks cool but no thanks.
    - asciicheck
    # Checks for dangerous unicode character sequences.
    # Super rare but why not to be a bit paranoid?
    - bidichk
    - bodyclose
    # Check whether the function uses a non-inherited context.
    - contextcheck
    # Check for two durations multiplied together.
    - durationcheck
    - depguard
    - dogsled
    - errcheck
    # Checks `Err-` prefix for var and `-Error` suffix for error type.
    - errname
    # Suggests to use `%w` for error-wrapping.
    - errorlint
    # Checks for pointers to enclosing loop variables.
    - exportloopref
    - goconst
    - gocritic
    # Forces to put `.` at the end of the comment. Code is poetry.
    - godot
    # Might not be that important, but I prefer to keep all of them.
    # `gofumpt` is amazing, kudos to Daniel Marti https://github.com/mvdan/gofumpt
    - gofmt
    - gofumpt
    - goimports
    - gosec
    - gosimple
    - govet
    - ineffassign
    - misspell
    - nakedret
    # Finds sending HTTP request without context.Context.
    - noctx
    # Finds slices that could potentially be pre-allocated.
    # Small performance win + cleaner code.
    - prealloc
    # Finds shadowing of Go's predeclared identifiers.
    # I hear a lot of complaints from junior developers.
    # But after some time they find it very useful.
    - predeclared
    # Lint your Prometheus metrics name.
    - promlinter
    # Checks that package variables are not reassigned.
    # Super rare case but can catch bad things (like `io.EOF = nil`)
    - reassign
    - revive
    - staticcheck
    - stylecheck
    # Checks that package variables are not reassigned.
    # Super rare case but can catch bad things (like `io.EOF = nil`)
    - reassign
    - typecheck
    # Test-related checks. All of them are good.
    - tenv
    - testableexamples
    - thelper
    - tparallel
    - unconvert
    - unused
    - unparam
    # Detect the possibility to use variables/constants from stdlib.
    - usestdlibvars
    # Finds wasted assignment statements.
    - wastedassign

Also linting tests to ensure better quality.

NO functionality is changed here. Most of the changes are just adding periods to comments

@aljo242
Copy link
Author

aljo242 commented Mar 29, 2023

Will regenerate all of the proto - idk how that got in

Copy link
Contributor

@ajansari95 ajansari95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good but- should revert the changes to generated files and some other comments also conflicts with #357 merged

@aljo242 aljo242 requested a review from ajansari95 March 29, 2023 19:55
Copy link
Contributor

@joe-bowman joe-bowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm now

@joe-bowman
Copy link
Contributor

@ajansari95

Copy link
Contributor

@ajansari95 ajansari95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ajansari95 ajansari95 merged commit 00907da into develop Mar 30, 2023
@ajansari95 ajansari95 deleted the chore/turbo-lint branch March 30, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants