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

golangci-lint: Fix GCI warnings #126

Merged
merged 1 commit into from Mar 7, 2022
Merged

Conversation

justaugustus
Copy link
Member

@justaugustus justaugustus commented Mar 6, 2022

Fixes needed for #122.

From https://golangci-lint.run/usage/linters/#gci:

linters-settings:
  gci:
    # DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
    local-prefixes: github.com/org/project
    # Checks that no inline Comments are present.
    # Default: false
    no-inline-comments: true
    # Checks that no prefix Comments(comment lines above an import) are present.
    # Default: false
    no-prefix-comments: true
    # Section configuration to compare against.
    # Section names are case-insensitive and may contain parameters in ().
    # Default: ["standard", "default"]
    sections:
      - standard # Captures all standard packages if they do not match another section.
      - default # Contains all imports that could not be matched to another section type.
      - comment(your text here) # Prints the specified indented comment.
      - newLine # Prints an empty line
      - prefix(github.com/org/project) # Groups all imports with the specified Prefix.
    # Separators that should be present between sections.
    # Default: ["newLine"]
    section-separators:
      - newLine

local-prefixes is deprecated, so we use sections here instead.

Because of a few things:

  • dependabot automatically updates golangci-lint-action versions
  • the gci linter warning is something that would've been caught with a newer version of golangci-lint

I've also dropped the version configuration, so it will default to using the latest version of golangci-lint when running CI.

Signed-off-by: Stephen Augustus foo@auggie.dev

@justaugustus justaugustus added this to In progress in Scorecard via automation Mar 6, 2022
@codecov
Copy link

codecov bot commented Mar 6, 2022

Codecov Report

Merging #126 (f777db7) into main (32323c1) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #126   +/-   ##
=======================================
  Coverage   66.39%   66.39%           
=======================================
  Files           1        1           
  Lines         247      247           
=======================================
  Hits          164      164           
  Misses         77       77           
  Partials        6        6           

...also, fixes some spacing issues in the config.

Signed-off-by: Stephen Augustus <foo@auggie.dev>
Copy link
Member

@naveensrinivasan naveensrinivasan left a comment

Choose a reason for hiding this comment

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

Thanks!

@justaugustus justaugustus merged commit d6456f6 into ossf:main Mar 7, 2022
Scorecard automation moved this from In progress to Reviewer approved Mar 7, 2022
Scorecard automation moved this from Reviewer approved to Done Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants