<commit_before>on: [push, pull_request]
name: "tests/lint"

jobs:
  test:
    strategy:
      matrix:
        go-version: [1.16.x]
        platform: [ubuntu-latest]
    runs-on: ${{ matrix.platform }}

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}

    - uses: actions/cache@v2
      with:
        path: ~/go/pkg/mod
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: ${{ runner.os }}-go-

    - name: Symlink source into GOPATH for devcam
      run: |
        mkdir $(go env GOPATH)/src
        ln -s $(pwd) $(go env GOPATH)/src/perkeep.org
    - name: Check for fmt compliance
      run: |
        go fmt ./...
        test -z "$(git status --porcelain)"
        go vet ./...
        go run dev/envvardoc/envvardoc.go
<commit_msg>Add staticcheck <commit_after>on: [push, pull_request]
name: "tests/lint"

jobs:
  test:
    strategy:
      matrix:
        go-version: [1.16.x]
        platform: [ubuntu-latest]
    runs-on: ${{ matrix.platform }}

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}

    - uses: actions/cache@v2
      with:
        path: ~/go/pkg/mod
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: ${{ runner.os }}-go-

    - name: Symlink source into GOPATH for devcam
      run: |
        mkdir $(go env GOPATH)/src
        ln -s $(pwd) $(go env GOPATH)/src/perkeep.org
    - name: Check for fmt compliance
      run: |
        go fmt ./...
        test -z "$(git status --porcelain)"
        go vet ./...
        go run dev/envvardoc/envvardoc.go

    - name: Run staticcheck with reviewdog
      # You may pin to the exact commit or the version.
      # uses: reviewdog/action-staticcheck@ebb262679ca6a0ab7b43ea94dbcbbc98ae077940
      uses: reviewdog/action-staticcheck@v1.7.0
      with:
        # Reporter of reviewdog command [github-check,github-pr-review].
        #reporter: # optional, default is github-pr-review
        #filter_mode: # optional, default is added
        #fail_on_error: # optional, default is false
        # Additional reviewdog flags
        # Target of staticcheck
        #target: # optional, default is ./...
        # staticcheck flags
        staticcheck_flags: '-checks=U1000'  # only unused (yet)

{'fraction_non_alphanumeric': 0.13951545530492898, 'fraction_numerical': 0.01670843776106934, 'mean_word_length': 1.9900124843945068, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4870753', 'n_tokens_mistral': 828, 'n_tokens_neox': 780, 'n_words': 201}