diff --git a/.github/.golangci.yml b/.github/.golangci.yml new file mode 100644 index 000000000..5c17c06e6 --- /dev/null +++ b/.github/.golangci.yml @@ -0,0 +1,10 @@ +linters: + disable-all: true + enable: + - gci +linters-settings: + gci: + sections: + - standard + - default + - Prefix(github.com/canonical/pebble) \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..7fe5a7b5b --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 \ No newline at end of file