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: enabling a few more linters #5961

Merged
merged 33 commits into from
Jan 25, 2024

Commits on Jan 2, 2024

  1. Adding asciicheck as a linter

    Checks that all code identifiers does not have non-ASCII symbols in the name.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    d8ef1c0 View commit details
    Browse the repository at this point in the history
  2. Adding bidichk as a linter

    Checks for dangerous unicode character sequences.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    722fa94 View commit details
    Browse the repository at this point in the history
  3. Adding asasalint as a linter

    Check for pass []any as any in variadic func(...any).
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    f2e3019 View commit details
    Browse the repository at this point in the history
  4. Adding doglsed as a linter

    Checks assignments with too many blank identifiers (e.g. x, , , _, := f()).
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    cf20b78 View commit details
    Browse the repository at this point in the history
  5. Adding containedctx and contextcheck to implicitly disabled

    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    79f24c0 View commit details
    Browse the repository at this point in the history
  6. Adding dupl as a linter (not for log filters)

    for code clone detection.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    de5f903 View commit details
    Browse the repository at this point in the history
  7. Adding decorder as a linter.

    Check declaration order and count of types, constants, variables and functions.
    
    Also adding cyclop to the list of implicitly disabled linters.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    1c34553 View commit details
    Browse the repository at this point in the history
  8. Adding dupword as a linter.

    Checks for duplicate words in the source code.
    
    Also fixed duplicate words in 3 files.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    483800a View commit details
    Browse the repository at this point in the history
  9. Adding durationcheck as a linter.

    Check for two durations multiplied together.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    6536bc2 View commit details
    Browse the repository at this point in the history
  10. Adding errchkjson to implicitly disabled linters

    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    75912d6 View commit details
    Browse the repository at this point in the history
  11. Adding exhaustive as a linter.

    Check exhaustiveness of enum switch statements.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    2c516fa View commit details
    Browse the repository at this point in the history
  12. Adding exportloopref as a linter.

    Checks for pointers to enclosing loop variables.
    
    Also adding exhaustruct to the list of implicitly disabled linters.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    60246e7 View commit details
    Browse the repository at this point in the history
  13. Adding whitespace as a linter.

    Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.
    
    Patching the few issues it found too.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    cac89c5 View commit details
    Browse the repository at this point in the history
  14. Adding zerologlint as a linter.

    Detects the wrong usage of zerolog that a user forgets to dispatch with Send or Msg.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    6070fa4 View commit details
    Browse the repository at this point in the history
  15. Adding wastedassign as a linter.

    Finds wasted assignment statements.
    
    Adding wrapcheck to the list of implicitly disabled linters.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    915354f View commit details
    Browse the repository at this point in the history
  16. Adding errname as a linter.

    Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
    
    Also fixing one case in reverse proxy and exporting the error to allow error matching against it.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    714476c View commit details
    Browse the repository at this point in the history
  17. Updating the list of implicitly disabled linters.

    To have all the current linters that aren't archived or deprecated as per golangci-lint.run/usage/linters/.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    be506d5 View commit details
    Browse the repository at this point in the history
  18. Fix exhaustive linter on windows on svc.Cmd

    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    5290384 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2024

  1. Configuration menu
    Copy the full SHA
    f28efb5 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2024

  1. Configuration menu
    Copy the full SHA
    2663edd View commit details
    Browse the repository at this point in the history
  2. Adding sloglint as a linter.

    Ensure consistent code style when using log/slog.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    ca35e7e View commit details
    Browse the repository at this point in the history
  3. Adding gofmt as a linter.

    Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    68e025f View commit details
    Browse the repository at this point in the history
  4. Adding goimports as a linter.

    Check import statements are formatted according to the 'goimport' command.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    f8e2ddd View commit details
    Browse the repository at this point in the history
  5. Adding importas as a linter.

    Enforces consistent import aliases.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    99c7ae0 View commit details
    Browse the repository at this point in the history
  6. Adding tparallel as a linter.

    Tparallel detects inappropriate usage of t.Parallel() method in Go test codes.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    c6f49f8 View commit details
    Browse the repository at this point in the history
  7. Adding testifylint as a linter.

    Checks proper usage of github.com/stretchr/testify.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    00e5cdc View commit details
    Browse the repository at this point in the history
  8. Adding testableexamples as a linter.

    This linter checks if examples are testable (have an expected output).
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    e8dd764 View commit details
    Browse the repository at this point in the history
  9. Adding tenv as a linter.

    Tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    a2182d9 View commit details
    Browse the repository at this point in the history
  10. Adding sqlclosecheck as a linter.

    Checks that sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    df496d7 View commit details
    Browse the repository at this point in the history
  11. Adding promlinter as a linter.

    Check Prometheus metrics naming via promlint.
    
    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    752e727 View commit details
    Browse the repository at this point in the history
  12. Merging with latest master

    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    dada8fd View commit details
    Browse the repository at this point in the history
  13. Use latest golangci-lint version in GHA.

    Signed-off-by: Yolan Romailler <[email protected]>
    AnomalRoil committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    ebb0944 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    fe73311 View commit details
    Browse the repository at this point in the history