-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
1,525 additions
and
1,598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{:lint-as {babashka.fs/with-temp-dir clojure.core/let}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{:hooks {:macroexpand {sci.core/copy-ns sci.core/copy-ns}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns sci.core) | ||
|
||
(defmacro copy-ns | ||
([ns-sym sci-ns] | ||
`(copy-ns ~ns-sym ~sci-ns nil)) | ||
([ns-sym sci-ns opts] | ||
`[(quote ~ns-sym) | ||
~sci-ns | ||
(quote ~opts)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{:hooks {:analyze-call {utils.i18n/label hooks.core/i18n-label}} | ||
:linters {:status-im.linter/invalid-translation-keyword {:level :error}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(ns hooks.core | ||
(:require [clj-kondo.hooks-api :as api])) | ||
|
||
(defn i18n-label | ||
"Verify call to `i18n/label` pass the translation keyword qualified with `t`." | ||
[{:keys [node]}] | ||
(let [[_ translation-key-node & _] (:children node)] | ||
(when (and (api/keyword-node? translation-key-node) | ||
(not= "t" (-> translation-key-node api/sexpr namespace))) | ||
(api/reg-finding! (assoc (meta translation-key-node) | ||
:message "Translation keyword should be qualified with \"t\"" | ||
:type :status-im.linter/invalid-translation-keyword))))) | ||
|
||
(comment | ||
;; Valid | ||
(i18n-label {:node (api/parse-string "(i18n/label :t/foo)")}) | ||
|
||
;; Invalid | ||
(i18n-label {:node (api/parse-string "(i18n/label :foo)")})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.