Skip to content

Commit

Permalink
Enforce import order using gci
Browse files Browse the repository at this point in the history
Add linting to the pre-merge checks to enforce Go import groups:
- stdlib
- 3rd-party / non-Pebble imports
- Pebble imports
  • Loading branch information
barrettj12 committed Jul 5, 2023
1 parent fe5189a commit f9c0755
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
linters:
disable-all: true
enable:
- gci
linters-settings:
gci:
sections:
- standard
- default
- Prefix(github.com/canonical/pebble)
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-mod-file: 'go.mod'
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: '-c .github/.golangci.yml'
skip-cache: true

0 comments on commit f9c0755

Please sign in to comment.