A GitHub Action to lint clojure files with clj-kondo and reviewdog on pull requests to improve the code review experience.
The clojure-lint-action is used in almost every Wall Brew repository. If you'd like to see a sample GitHub workflow using this linter, please check out spoon That action was used as a CI/CD check in this Pull Request.
Optional.
${{ github.token }}
is used by default.
Optional.
Report level for reviewdog- must be one of [info, warning, error]
.
It's same as -level
flag of reviewdog.
Reporter of reviewdog command.
Must be one of [github-pr-check, github-pr-review, github-check]
.
Default is github-pr-check.
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
Optional.
Filtering mode for the reviewdog command.
Must be one of [added, diff_context, file, nofilter]
.
Default is added.
Optional.
Sets and exceptional exit code for reviewdog when errors are found.
Must be one of [true, false]
.
Default is false
.
Optional. Additional reviewdog flags.
Optional.
Base directory to run clj-kondo.
Same as [path]
of find
command.
Default: .
Optional.
File patterns of target files.
Same as -name [pattern]
of find
command.
Default: *.clj*
(To capture *.clj
, *.cljs
, *.cljc
, and *.cljx
)
Optional.
Exclude patterns of target files.
Same as -not -path [exclude]
of find
command.
e.g. ./git/*
Optional.
Flags to pass to clj-kondo's --config
option, which may either be in-line options or a path to a config file.
Default: '{:output {:pattern "{{filename}}:{{row}}:{{col}}: {{message}}"}}'
To receive automatic Pull Request comments with linter results:
name: Lint Clojure
on: [pull_request]
jobs:
clj-kondo:
name: runner / clj-kondo
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: clj-kondo
uses: nnichols/clojure-lint-action@v2
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
Copyright © 2021-2024 Nick Nichols
Distributed under the MIT License