diff --git a/.github/workflows/prettier-pr.yml b/.github/workflows/prettier-pr.yml new file mode 100644 index 000000000..b27a68e9c --- /dev/null +++ b/.github/workflows/prettier-pr.yml @@ -0,0 +1,54 @@ +name: Prettier hook for PRs + +on: + pull_request: + types: [opened, synchronize, reopened, closed] + branches: [develop, master] + push: + branches: [develop, master] + +jobs: + ci-pr: + # Run on any change from PR or direct push, but don't run on a cancel PR + if: github.event_name != 'pull_request' || ( + github.event.action == 'opened' || + github.event.action == 'synchronize' || + github.event.action == 'reopened' && github.event.before != github.event.after || + github.event.action == 'closed' && github.event.pull_request.merged == true + ) + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "latest" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Confirm code format + run: npm prettier + + - name: Commit changes + run: | + git config --global user.name "maria[bot]" + git config --global user.email "maria[bot]@users.noreply.github.com" + git add . + git commit -m "Auto-format code with prettier" || echo "No changes to commit" + git push + + ci-close-pr: + # Run on a cancel PR + if: github.event_name == 'pull_request' && github.event.pull_request.merged == false + + runs-on: ubuntu-latest + + steps: + - name: Just report closed, nothing to do + run: | + echo PR #${{ github.event.number }} has been closed, not merged diff --git a/.jshintrc b/.jshintrc index 045136980..3a8941c3c 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,6 @@ { - "esversion": 11, - "node": true, + "esversion": 11, + "node": true, "browser": true, "bitwise": true, "camelcase": true, @@ -21,27 +21,27 @@ "-W069": true, "-W083": true, "-W084": true, - "globals": { - "iceStudio":false, - "Icestudio":false, - "iceStudioReady":false, - "domCache":false, - "iprof":false, - "IceProfiler":false, - "IceBlock":false, - "subModuleActive":false, - "ICEpm":false, - "IcePlugManager":false, - "iceConsole":false, - "IceLogger":false, - "IceEventBus":false, - "IceTemplateSystem":false, - "IceParametricHelper":false, - "Mustache":false, - "jexcel":false, - "nw":false, - "Snap":false, - "mina":false, + "globals": { + "iceStudio": false, + "Icestudio": false, + "iceStudioReady": false, + "domCache": false, + "iprof": false, + "IceProfiler": false, + "IceBlock": false, + "subModuleActive": false, + "ICEpm": false, + "IcePlugManager": false, + "iceConsole": false, + "IceLogger": false, + "IceEventBus": false, + "IceTemplateSystem": false, + "IceParametricHelper": false, + "Mustache": false, + "jexcel": false, + "nw": false, + "Snap": false, + "mina": false, "$": false, "angular": false, "console": false, @@ -55,7 +55,7 @@ "ace": false, "g": false, "V": false, - "IceCollection":false, + "IceCollection": false, "IceHD": false, "WafleModal": false } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..46d7aba94 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +resources/libs/vendor/ +resources/fonts/ +*.md +icerok/vendor/sweetalert2.min.js +icerok/css/*.min.css +Gruntfile.js diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..30b4336be --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "quoteProps": "consistent", + "trailingComma": "es5" +} diff --git a/Gruntfile.js b/Gruntfile.js index e217ce3df..2af3eb5fc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -824,7 +824,7 @@ module.exports = function (grunt) { }, //-- Download NWjs for ARM arquitecture, as it is not part of the - //-- oficial NWjs project + //-- official NWjs project //-- It is downloaded during the ARM build process //-- Only ARM nwjsAarch64: { @@ -1234,8 +1234,7 @@ module.exports = function (grunt) { path: MAC_EXEC_FILE, }, ], - /* -- For code oficial packages of Icestudio, for developers maintain commented - + /* -- For code official packages of Icestudio, for developers maintain commented "code-sign": { "signing-identity": "XXXX", } diff --git a/app/index.html b/app/index.html index 2ddfed62f..fbadf9665 100644 --- a/app/index.html +++ b/app/index.html @@ -1,79 +1,80 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+