From 659a87795a2d5ad89ce9c2934c868fa4fe5756c7 Mon Sep 17 00:00:00 2001 From: Ace Ci Bot Date: Mon, 1 Apr 2024 01:08:02 +0400 Subject: [PATCH] ci fixes --- .github/workflows/nodejs.yml | 28 +++++++++++++++++++++++++--- package.json | 1 + src/keyboard/hash_handler.js | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 56a36d8505b..38f3584a3fa 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,6 +33,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm i - run: npm run cover + # run linter - run: | set -x; git status; @@ -40,17 +41,18 @@ jobs: changes=$(git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR); if [ "$changes" == "" ]; then echo "checking all files"; - node node_modules/eslint/bin/eslint "lib/ace/**/*.js"; + node node_modules/eslint/bin/eslint --fix "lib/ace/**/*.js"; else jsChanges=$(echo "$changes" | grep -P '.js$' || :); if [ "$jsChanges" == "" ]; then echo "nothing to check"; else echo "checking $jsChanges"; - node node_modules/eslint/bin/eslint $jsChanges; + node node_modules/eslint/bin/eslint --fix $jsChanges; fi fi - # - run: npm run lint + # check types + - run: npm run update-types - run: node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts - run: npm run typecheck - uses: codecov/codecov-action@v3 @@ -60,3 +62,23 @@ jobs: flags: unittests name: codecov-umbrella fail_ci_if_error: true + # push automatic fixes to the pull request + - run: | + set -x; + git status; + git add -u + git reset -- build + git config user.name "Ace Ci Bot" + git config user.email "bot@c9.io" + git commit -m "ci fixes" --author="Ace Ci Bot " + git branch -F CI_FIXES + git remote -v + git log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- + # git push origin + + - name: Checkout PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr checkout ${{ github.event.pull_request.number }} + - run: git cherry-pick CI_FIXES + - run: git push \ No newline at end of file diff --git a/package.json b/package.json index d50651fd8b9..8a1a040f01d 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "lint": "eslint \"src/**/*.js\"", "fix": "eslint --fix \"src/**/*.js\"", "typecheck": "tsc -p tsconfig.json", + "update-types": "node ./tool/modes-declaration-generator.js", "changelog": "standard-version", "prepack": "node tool/esm_resolver_generator.js && node Makefile.dryice.js css --target build-styles && rm -rf styles && mv build-styles/css styles" }, diff --git a/src/keyboard/hash_handler.js b/src/keyboard/hash_handler.js index d445f5f2924..07e9d61a250 100644 --- a/src/keyboard/hash_handler.js +++ b/src/keyboard/hash_handler.js @@ -297,4 +297,4 @@ MultiHashHandler.call = function(thisArg, config, platform) { }; exports.HashHandler = HashHandler; -exports.MultiHashHandler = MultiHashHandler; +exports.MultiHashHandler = MultiHashHandler