Add standard lint tasks to common lib

This commit is contained in:
Gabriel Horner
2023-05-10 10:36:05 -04:00
committed by Tienson Qin
parent 91beda09d5
commit c86fd3cd4d
3 changed files with 98 additions and 4 deletions

View File

@@ -34,6 +34,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache-dependency-path: deps/publishing/yarn.lock
- name: Set up Java
uses: actions/setup-java@v3
with:
@@ -46,8 +53,15 @@ jobs:
cli: ${{ env.CLOJURE_VERSION }}
bb: ${{ env.BABASHKA_VERSION }}
- name: Run clj-kondo lint
run: clojure -M:clj-kondo --parallel --lint src test
- name: Fetch yarn deps
run: yarn install --frozen-lockfile
- name: Run nbb-logseq tests
run: yarn test
# In this job because it depends on an npm package
- name: Load namespaces into nbb-logseq
run: bb test:load-all-namespaces-with-nbb .
- name: Clojure cache
uses: actions/cache@v3
@@ -65,3 +79,34 @@ jobs:
- name: Run ClojureScript tests
run: clojure -M:test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@10.1
with:
cli: ${{ env.CLOJURE_VERSION }}
bb: ${{ env.BABASHKA_VERSION }}
- name: Run clj-kondo lint
run: clojure -M:clj-kondo --lint src test
- name: Carve lint for unused vars
run: bb lint:carve
- name: Lint for vars that are too large
run: bb lint:large-vars
- name: Lint for namespaces that aren't documented
run: bb lint:ns-docstrings