From 1af99f534bdbd2dc93a2faaa4f5576d696bc7bb5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 30 Jan 2025 14:41:33 +0100 Subject: [PATCH 1/3] :paperclip: Fix linter issues --- .clj-kondo/config.edn | 6 ++++++ common/shadow-cljs.edn | 2 +- common/src/app/common/files/repair.cljc | 2 +- frontend/shadow-cljs.edn | 2 +- frontend/src/app/worker/import.cljs | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn index 5675b9d5d3..08c3cd7e8f 100644 --- a/.clj-kondo/config.edn +++ b/.clj-kondo/config.edn @@ -58,6 +58,12 @@ :redundant-do {:level :off} + :redundant-ignore + {:level :off} + + :redundant-nested-call + {:level :off} + :earmuffed-var-not-dynamic {:level :off} diff --git a/common/shadow-cljs.edn b/common/shadow-cljs.edn index fc3f4be04a..bd4cafa823 100644 --- a/common/shadow-cljs.edn +++ b/common/shadow-cljs.edn @@ -9,7 +9,7 @@ :modules {:test {:init-fn common-tests.runner/-main - :prepend-js "globalThis.navigator = {userAgent: \"\"}"}}} + :prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}} :bench {:target :node-script diff --git a/common/src/app/common/files/repair.cljc b/common/src/app/common/files/repair.cljc index 5d80c844ff..2d486ba6c9 100644 --- a/common/src/app/common/files/repair.cljc +++ b/common/src/app/common/files/repair.cljc @@ -494,7 +494,7 @@ (let [repair-shape (fn [shape] ;; Remove the swap slot - (log/debug :hint (str " -> remove swap-slot")) + (log/debug :hint " -> remove swap-slot") (ctk/remove-swap-slot shape))] (log/dbg :hint "repairing shape :misplaced-slot" :id (:id shape) :name (:name shape) :page-id page-id) diff --git a/frontend/shadow-cljs.edn b/frontend/shadow-cljs.edn index a0673a0e9c..4aad071ae6 100644 --- a/frontend/shadow-cljs.edn +++ b/frontend/shadow-cljs.edn @@ -144,7 +144,7 @@ :modules {:test {:init-fn frontend-tests.runner/init - :prepend-js "globalThis.navigator = {userAgent: \"\"}"}}} + :prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}} :lib-penpot {:target :esm diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index ebeb67daa8..950c98ffba 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -72,7 +72,7 @@ ([context type id media] (let [file-id (:file-id context) path (case type - :manifest (str "manifest.json") + :manifest "manifest.json" :page (str file-id "/" id ".svg") :colors-list (str file-id "/colors.json") :colors (let [ext (cm/mtype->extension (:mtype media))] From 59c27320144df179644c2028397d24bcab3e61f7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 30 Jan 2025 14:51:38 +0100 Subject: [PATCH 2/3] :paperclip: Import from develop github workflows --- .github/workflows/commit-checker.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/commit-checker.yml diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml new file mode 100644 index 0000000000..7ad5c11015 --- /dev/null +++ b/.github/workflows/commit-checker.yml @@ -0,0 +1,50 @@ +name: 'Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + push: + branches: + - main + - develop + - staging + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Commit Type + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^:(lipstick|globe_with_meridians|wrench|books|arrow_up|zap|ambulance|construction|boom|fire|whale|bug|sparkles|paperclip|tada|recycle):\s[A-Z].*[^.]$' + flags: 'gm' + error: 'Commit should match CONTRIBUTING.md guideline' + checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request + accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true + + # - name: Check Line Length + # uses: gsactions/commit-message-checker@v2 + # with: + # pattern: '^[^#].{74}' + # error: 'The maximum line length of 74 characters is exceeded.' + # excludeDescription: 'true' # optional: this excludes the description body of a pull request + # excludeTitle: 'true' # optional: this excludes the title of a pull request + # checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request + # accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is ue + # - name: Check for Resolves / Fixes + # uses: gsactions/commit-message-checker@v2 + # with: + # pattern: '^.+(Resolves|Fixes): \#[0-9]+$' + # error: 'You need at least one "Resolves|Fixes: #" line.' + + From eac18afa0cd8a658145b66b89c97e0e469bf64ff Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 30 Jan 2025 16:19:28 +0100 Subject: [PATCH 3/3] :paperclip: Fix linter issues --- frontend/src/app/worker.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/app/worker.cljs b/frontend/src/app/worker.cljs index 502e3d67e1..213d20ae2b 100644 --- a/frontend/src/app/worker.cljs +++ b/frontend/src/app/worker.cljs @@ -168,7 +168,6 @@ (.removeEventListener js/self "message" on-message)) (defn ^:dev/after-load start [] - [] (set! process-message-sub (subscribe-buffer-messages)) (.addEventListener js/self "message" on-message))