From 574bef0b3cf0a707a4b44008242d7d939b709aad Mon Sep 17 00:00:00 2001 From: goedelsoup Date: Fri, 19 Jun 2020 14:30:28 -0400 Subject: [PATCH 01/10] Add support for Clojure with clj-kondo --- .automation/test/clojure/README.md | 13 +++++ .automation/test/clojure/clojure_bad_1.clj | 64 +++++++++++++++++++++ .automation/test/clojure/clojure_good_1.clj | 35 +++++++++++ Dockerfile | 9 +++ README.md | 2 + lib/linter.sh | 58 ++++++++++++++++++- 6 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 .automation/test/clojure/README.md create mode 100644 .automation/test/clojure/clojure_bad_1.clj create mode 100644 .automation/test/clojure/clojure_good_1.clj diff --git a/.automation/test/clojure/README.md b/.automation/test/clojure/README.md new file mode 100644 index 00000000..6606ef5b --- /dev/null +++ b/.automation/test/clojure/README.md @@ -0,0 +1,13 @@ +# Clojure Test Cases +This folder holds the test cases for **Clojure**. + +## Additional Docs +No Additional information is needed for this test case. + +## Good Test Cases +The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. +- **Note:** They are linted utilizing the default linter rules. + +## Bad Test Cases +The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. +- **Note:** They are linted utilizing the default linter rules. diff --git a/.automation/test/clojure/clojure_bad_1.clj b/.automation/test/clojure/clojure_bad_1.clj new file mode 100644 index 00000000..c8366066 --- /dev/null +++ b/.automation/test/clojure/clojure_bad_1.clj @@ -0,0 +1,64 @@ +(ns foo + (:require + [clojure.string :as str] + ;; We're never using this namespace. Also, the namespaces aren't sorted. + [clojure.set :as set])) + +;; Here we made a typo, so the symbol is unresolved: +(but-last [1 2 3]) + +;; Clj-kondo knows about arities of clojure namespaces, but you can also teach +;; it about your libraries or own namespaces +(str/join) + +;; foo has an arity of 2, but we're not actually using y +(defn foo-fn [x y] + ;; this do is redundant: + (do + ;; this is handy for debugging, but please remove it before pushing your code: + (def tmp_x x) + (let [y (fn [] (inc x))] + ;; the next let can be squashed together with the previous: + (let [z y] + ;; whoopsy, calling a local function with an incorrect number of args: + (y x) + ;; also wrong: + (recur))))) + +(letfn + [(f [] (h 1)) + (h [] (f 1))]) + +(defn- private-fn []) +;; redefining it... +(defn- private-fn []) + +(defn foo [] :foo) +;; Type error, because foo doesn't return a number! +(inc (foo)) + +;; I'm tired now, let's sleep... +;; Oops, not happening because of wrong amount of args: +(Thread/sleep 1000 1 2) + +;; Here we switch to another namespace and require the previous: +(ns bar (:require [foo :as f])) + +;; Wrong arity when calling a function from the previous namespace: +(f/foo-fn) + +;; private: +(f/private-fn) + +;; this won't pass the reader: +{:a 1 :a 2} +;; and neither will this: +#{1 1} +;; nor this: +{:a 1 :b} + +(ns bar-test (:require [clojure.test :as t])) + +(t/deftest my-tests + ;; you're not actually testing something here: + (odd? (inc 1))) \ No newline at end of file diff --git a/.automation/test/clojure/clojure_good_1.clj b/.automation/test/clojure/clojure_good_1.clj new file mode 100644 index 00000000..7ea739e1 --- /dev/null +++ b/.automation/test/clojure/clojure_good_1.clj @@ -0,0 +1,35 @@ +(ns foo + (:require + [clojure.string :as str])) + +(butlast [1 2 3]) + +(str/join "" "") + +(defn foo-fn [x] + (let [y (fn [] (inc x)) + z y] + (y))) + +(letfn + [(f [g] (h g)) + (h [i] (f i))]) + +(defn foo [] 1) +(inc (foo)) + +(Thread/sleep 1000 1) + +;; Here we switch to another namespace and require the previous: +(ns bar (:require [foo :as f])) + +(f/foo-fn 1) + +{:a 1 :b 2} +#{1 2} +{:a 1 :b 2} + +(ns bar-test (:require [clojure.test :as t])) + +(t/deftest my-tests + (t/is (odd? (inc 1)))) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7f655c31..f66fb596 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,6 +102,14 @@ RUN wget -O- -nvq https://raw.githubusercontent.com/golangci/golangci-lint/maste RUN curl -Ls "$(curl -Ls https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" -o tflint.zip && unzip tflint.zip && rm tflint.zip \ && mv "tflint" /usr/bin/ +##################### +# Install clj-kondo # +##################### +RUN curl -sLO https://github.com/borkdude/clj-kondo/releases/download/v2020.06.12/clj-kondo-2020.06.12-linux-static-amd64.zip \ + && unzip clj-kondo-2020.06.12-linux-static-amd64.zip \ + && rm clj-kondo-2020.06.12-linux-static-amd64.zip \ + && mv clj-kondo /usr/bin/ + ########################################### # Load GitHub Env Vars for GitHub Actions # ########################################### @@ -128,6 +136,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ VALIDATE_GO=${VALIDATE_GO} \ VALIDATE_TERRAFORM=${VALIDATE_TERRAFORM} \ VALIDATE_CSS=${VALIDATE_CSS} \ + VALIDATE_CLOJURE=${VALIDATE_CLOJURE} \ ANSIBLE_DIRECTORY=${ANSIBLE_DIRECTORY} \ RUN_LOCAL=${RUN_LOCAL} \ TEST_CASE_RUN=${TEST_CASE_RUN} \ diff --git a/README.md b/README.md index b7f5455d..4a001385 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base | --- | --- | | **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) | | **CSS** | [stylelint](https://stylelint.io/) | +| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) | | **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) | | **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) | | **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) | @@ -135,6 +136,7 @@ and won't run anything unexpected. | **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_TERRAFORM** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the language. | +| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. | | **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s). | | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | diff --git a/lib/linter.sh b/lib/linter.sh index b96f44ec..c1c46b7a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -51,6 +51,9 @@ TERRAFORM_LINTER_RULES="$DEFAULT_RULES_LOCATION/$TERRAFORM_FILE_NAME" # Path # CSS Vars CSS_FILE_NAME='.stylelintrc.json' # Name of the file CSS_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CSS_FILE_NAME" # Path to the CSS lint rules +# Clojure Vars +CLOJURE_FILE_NAME='.clj-kondo/config.edn' +CLOJURE_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CLOJURE_FILE_NAME" ####################################### @@ -59,14 +62,15 @@ CSS_LINTER_RULES="$DEFAULT_RULES_LOCATION/$CSS_FILE_NAME" # Path to th LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck" "pylint" "perl" "rubocop" "coffeelint" "eslint" "standard" "ansible-lint" "/dockerfilelint/bin/dockerfilelint" "golangci-lint" "tflint" - "stylelint") + "stylelint" "clj-kondo") ############################# # Language array for prints # ############################# LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RUBY' 'PYTHON' 'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' - 'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM' 'CSS') + 'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM' 'CSS' + 'CLOJURE') ################### # GitHub ENV Vars # @@ -95,6 +99,7 @@ VALIDATE_DOCKER="${VALIDATE_DOCKER}" # Boolean to validate lang VALIDATE_GO="${VALIDATE_GO}" # Boolean to validate language VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM}" # Boolean to validate language VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate language +VALIDATE_CLOJURE="${VALIDATE_CLOJURE}" # Boolean to validate language TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases ############## @@ -136,6 +141,7 @@ FILE_ARRAY_DOCKER=() # Array of files to check FILE_ARRAY_GO=() # Array of files to check FILE_ARRAY_TERRAFORM=() # Array of files to check FILE_ARRAY_CSS=() # Array of files to check +FILE_ARRAAY_CLOJURE=() # Array of files to check ############ # Counters # @@ -158,6 +164,7 @@ ERRORS_FOUND_DOCKER=0 # Count of errors found ERRORS_FOUND_GO=0 # Count of errors found ERRORS_FOUND_TERRAFORM=0 # Count of errors found ERRORS_FOUND_CSS=0 # Count of errors found +ERRORS_FOUND_CLOJURE=0 # Count of errors found ################################################################################ ########################## FUNCTIONS BELOW ##################################### @@ -735,6 +742,7 @@ GetValidationInfo() VALIDATE_GO=$(echo "$VALIDATE_GO" | awk '{print tolower($0)}') VALIDATE_TERRAFORM=$(echo "$VALIDATE_TERRAFORM" | awk '{print tolower($0)}') VALIDATE_CSS=$(echo "$VALIDATE_CSS" | awk '{print tolower($0)') + VALIDATE_CLOJURE=$(echo "$VALIDATE_CLOJURE" | awk '{print tolower($0)') ################################################ # Determine if any linters were explicitly set # @@ -757,7 +765,8 @@ GetValidationInfo() -n "$VALIDATE_DOCKER" || \ -n "$VALIDATE_GO" || \ -n "$VALIDATE_TERRAFORM" || \ - -n "$VALIDATE_CSS" ]]; then + -n "$VALIDATE_CSS" || \ + -n "$VALIDATE_CLOJURE" ]]; then ANY_SET="true" fi @@ -1013,6 +1022,20 @@ GetValidationInfo() VALIDATE_CSS="true" fi + ####################################### + # Validate if we should check Clojure # + ####################################### + if [[ "$ANY_SET" == "true" ]]; then + # Some linter flags were set - only run those set to true + if [[ -z "$VALIDATE_CLOJURE" ]]; then + # Clojure flag was not set - default to false + VALIDATE_CLOJURE="false" + fi + else + # No linter flags were set - default all to true + VALIDATE_CLOJURE="true" + fi + ####################################### # Print which linters we are enabling # ####################################### @@ -1106,6 +1129,11 @@ GetValidationInfo() else PRINT_ARRAY+=("- Excluding [CSS] files in code base...") fi + if [[ "$VALIDATE_CLOJURE" == "true" ]]; then + PRINT_ARRAY+=("- Validating [CLOJURE] files in code base...") + else + PRINT_ARRAY+=("- Excluding [CLOJURE] files in code base...") + fi ############################## # Validate Ansible Directory # @@ -1431,6 +1459,15 @@ BuildFileList() # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 + elif [ "$FILE" == "clj" ] || [ "$FILE" == "cljs" ] || [ "$FILE" == "cljc" ] || [ "$FILE" == "edn" ]; then + ################################ + # Append the file to the array # + ################################ + FILE_ARRAY_CLOJURE+=("$FILE") + ########################################################## + # Set the READ_ONLY_CHANGE_FLAG since this could be exec # + ########################################################## + READ_ONLY_CHANGE_FLAG=1 else ############################################## # Use file to see if we can parse what it is # @@ -1986,6 +2023,7 @@ RunTestCases() TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c $ANSIBLE_LINTER_RULES" "ansible-lint" TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" + TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\)\$" ################# # Footer prints # @@ -2282,6 +2320,20 @@ if [ "$VALIDATE_DOCKER" == "true" ]; then LintCodebase "DOCKER" "/dockerfilelint/bin/dockerfilelint" "/dockerfilelint/bin/dockerfilelint" ".*\(Dockerfile\)\$" "${FILE_ARRAY_DOCKER[@]}" fi +################### +# CLOJURE LINTING # +################### +if [ "$VALIDATE_CLOJURE" == "true" ]; then + ################################# + # Get Clojure standard rules # + ################################# + GetStandardRules "clj-kondo" + ######################### + # Lint the Clojure files # + ######################### + LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\)\$" "${FILE_ARRAY_CLOJURE[@]}" +fi + ########## # Footer # ########## From 69b98486a3645a62d769dd34389072e0338e660d Mon Sep 17 00:00:00 2001 From: goedelsoup Date: Fri, 19 Jun 2020 14:31:50 -0400 Subject: [PATCH 02/10] fix typo in variable name --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index c1c46b7a..53828113 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -141,7 +141,7 @@ FILE_ARRAY_DOCKER=() # Array of files to check FILE_ARRAY_GO=() # Array of files to check FILE_ARRAY_TERRAFORM=() # Array of files to check FILE_ARRAY_CSS=() # Array of files to check -FILE_ARRAAY_CLOJURE=() # Array of files to check +FILE_ARRAY_CLOJURE=() # Array of files to check ############ # Counters # From 8a5be8d448427c01a2eb38aec156fab7333fa7cf Mon Sep 17 00:00:00 2001 From: goedelsoup Date: Fri, 19 Jun 2020 14:34:53 -0400 Subject: [PATCH 03/10] make clj-kondo version a build arg --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f66fb596..2529279a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,9 +105,10 @@ RUN curl -Ls "$(curl -Ls https://api.github.com/repos/terraform-linters/tflint/r ##################### # Install clj-kondo # ##################### -RUN curl -sLO https://github.com/borkdude/clj-kondo/releases/download/v2020.06.12/clj-kondo-2020.06.12-linux-static-amd64.zip \ - && unzip clj-kondo-2020.06.12-linux-static-amd64.zip \ - && rm clj-kondo-2020.06.12-linux-static-amd64.zip \ +ARG CLJ_KONDO_VERSION='2020.06.12' +RUN curl -sLO https://github.com/borkdude/clj-kondo/releases/download/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip \ + && unzip clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip \ + && rm clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip \ && mv clj-kondo /usr/bin/ ########################################### From 5063d7cb6c03e3aa8c7031b5b7e3bdb46e63e4f7 Mon Sep 17 00:00:00 2001 From: goedelsoup Date: Mon, 22 Jun 2020 08:39:32 -0400 Subject: [PATCH 04/10] fix clojure file regex --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 82a3ebaf..e4c7d218 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -2088,7 +2088,7 @@ RunTestCases() TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$" - TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\)\$" + TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\|cljs\|cljc\|edn\)\$" ################# # Footer prints # @@ -2407,7 +2407,7 @@ if [ "$VALIDATE_CLOJURE" == "true" ]; then ######################### # Lint the Clojure files # ######################### - LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\)\$" "${FILE_ARRAY_CLOJURE[@]}" + LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "${FILE_ARRAY_CLOJURE[@]}" fi ########## From 7a298710713bbbe52efc450161aa7770ccc59fb8 Mon Sep 17 00:00:00 2001 From: goedelsoup Date: Tue, 23 Jun 2020 09:43:29 -0400 Subject: [PATCH 05/10] add documentation to configuration --- .github/linters/.clj-kondo/config.edn | 2 ++ .gitignore | 3 +++ docs/disabling-linters.md | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 .github/linters/.clj-kondo/config.edn diff --git a/.github/linters/.clj-kondo/config.edn b/.github/linters/.clj-kondo/config.edn new file mode 100644 index 00000000..30cae4c6 --- /dev/null +++ b/.github/linters/.clj-kondo/config.edn @@ -0,0 +1,2 @@ +{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]} + :refer-all {:exclude [clj-time.jdbc]}}} diff --git a/.gitignore b/.gitignore index ad46b308..ae755b39 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ typings/ # next.js build output .next + +# clj-kondo cache +.cache \ No newline at end of file diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 0efb4d27..45fa6957 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -607,3 +607,22 @@ import package.b.* ### ktlint disable entire file - There is currently **No** way to disable rules inline of the file(s) + +-------------------------------------------------------------------------------- + +## Clojure +- [clj-kondo](https://github.com/borkdude/clj-kondo) + +### clj-kondo standard Config file +- `.github/linters/.clj-kondo/config.edn` + +### clj-kondo disable single line +- There is currently **No** way to disable rules in a single line + +### clj-kondo disable code block +- There is currently **No** way to disable rules in a code block + +### clj-kondo disable entire file +```clojure +{:output {:exclude-files ["path/to/file"]}} +``` From a52fd6a5fe44eb9dc13b729519847081665fcb4e Mon Sep 17 00:00:00 2001 From: goedelsoup Date: Tue, 23 Jun 2020 09:46:15 -0400 Subject: [PATCH 06/10] link to clj-kondo docs --- docs/disabling-linters.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 45fa6957..5b11ee51 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -612,6 +612,7 @@ import package.b.* ## Clojure - [clj-kondo](https://github.com/borkdude/clj-kondo) +- Since clj-kondo approaches static analysis in a very Clojure way, it is advised to read the [configuration docs](https://github.com/borkdude/clj-kondo/blob/master/doc/config.md) ### clj-kondo standard Config file - `.github/linters/.clj-kondo/config.edn` From b922ece707b9a57c7ad42c9159fdd6bdbab7c217 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 23 Jun 2020 12:45:57 -0500 Subject: [PATCH 07/10] found missing var --- lib/linter.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 5c8042bd..5f7af0c9 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -150,7 +150,7 @@ FILE_ARRAY_TYPESCRIPT_STANDARD=() # Array of files to check FILE_ARRAY_DOCKER=() # Array of files to check FILE_ARRAY_GO=() # Array of files to check FILE_ARRAY_TERRAFORM=() # Array of files to check -FILE_ARRAY_POWERSHELL=() # Array of files to check +FILE_ARRAY_POWERSHELL=() # Array of files to check FILE_ARRAY_CSS=() # Array of files to check FILE_ARRAY_ENV=() # Array of files to check FILE_ARRAY_CLOJURE=() # Array of files to check @@ -2159,6 +2159,7 @@ Footer() [ "$ERRORS_FOUND_RUBY" -ne 0 ] || \ [ "$ERRORS_FOUND_CSS" -ne 0 ] || \ [ "$ERRORS_FOUND_ENV" -ne 0 ] || \ + [ "$ERRORS_FOUND_CLOJURE" -ne 0 ] || \ [ "$ERRORS_FOUND_KOTLIN" -ne 0 ]; then # Failed exit echo "Exiting with errors found!" From e2eaf633277bc11514231f62dc9541fe47861740 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 24 Jun 2020 08:35:56 -0500 Subject: [PATCH 08/10] Adding config to templates --- TEMPLATES/.clj-kondo/config.edn | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 TEMPLATES/.clj-kondo/config.edn diff --git a/TEMPLATES/.clj-kondo/config.edn b/TEMPLATES/.clj-kondo/config.edn new file mode 100644 index 00000000..30cae4c6 --- /dev/null +++ b/TEMPLATES/.clj-kondo/config.edn @@ -0,0 +1,2 @@ +{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]} + :refer-all {:exclude [clj-time.jdbc]}}} From b26f7eda6d9c5f88cce367f34bad8bad8a78a8c4 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Wed, 24 Jun 2020 09:51:16 -0500 Subject: [PATCH 09/10] fixed command --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 74ea060a..39921b04 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -2221,7 +2221,7 @@ RunTestCases() TestCodebase "POWERSHELL" "pwsh" "pwsh -c Invoke-ScriptAnalyzer -EnableExit -Settings $POWERSHELL_LINTER_RULES -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$" TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$" - TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\|cljs\|cljc\|edn\)\$" + TestCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" ################# @@ -2565,7 +2565,7 @@ if [ "$VALIDATE_CLOJURE" == "true" ]; then ######################### # Lint the Clojure files # ######################### - LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "${FILE_ARRAY_CLOJURE[@]}" + LintCodebase "CLOJURE" "clj-kondo" "clj-kondo --config $CLOJURE_LINTER_RULES --lint" ".*\.\(clj\|cljs\|cljc\|edn\)\$" "${FILE_ARRAY_CLOJURE[@]}" fi ###################### From b80ea7e335ae4c3a18007c3372e6d9b91a87e09d Mon Sep 17 00:00:00 2001 From: danielcompton Date: Thu, 25 Jun 2020 20:06:44 +1200 Subject: [PATCH 10/10] Remove unused binding from good Clojure test file Prevents clj-kondo from warning about an unused binding. --- .automation/test/clojure/clojure_good_1.clj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.automation/test/clojure/clojure_good_1.clj b/.automation/test/clojure/clojure_good_1.clj index 7ea739e1..391f4688 100644 --- a/.automation/test/clojure/clojure_good_1.clj +++ b/.automation/test/clojure/clojure_good_1.clj @@ -7,8 +7,7 @@ (str/join "" "") (defn foo-fn [x] - (let [y (fn [] (inc x)) - z y] + (let [y (fn [] (inc x))] (y))) (letfn