From 92090b60b54f3381f50924a630ed7b80edccd13e Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 29 Apr 2021 13:53:58 +0200 Subject: [PATCH] Update workflow --- .github/workflows/workflow.yml | 6 +++++- package.json | 2 +- source/.eslintrc.yml | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 11fe2970..51eaae0a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -72,6 +72,7 @@ jobs: name: Format code runs-on: ubuntu-latest needs: [ build, analyze ] + if: github.event_name == 'push' && github.head_ref == 'refs/heads/master' steps: - name: Checkout repository uses: actions/checkout@v2 @@ -81,15 +82,18 @@ jobs: run: | curl -fsSL https://dprint.dev/install.sh | sh echo "$HOME/.dprint/bin" >> $GITHUB_PATH + - name: Checkout master + run: git checkout master - name: Format code run: npm run fmt - name: Publish formatted code - if: false #github.event_name == 'pull_request' && github.ref != 'refs/heads/master' run: | + set +e git status # git add --update # git commit -m "Auto-format code" # git push + set -e # Update plugins and template indexes, along with README.md update-indexes: diff --git a/package.json b/package.json index 5f085aaa..39b64be6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "index": "node .github/index.mjs", "quickstart": "node .github/quickstart/index.mjs", "preview": "node .github/preview.mjs", - "linter": "eslint source/**/*.mjs", + "linter": "eslint source/**/*.mjs --quiet", "dev": "nodemon source/app/web/index.mjs -e mjs,css,ejs,json", "postinstall": "node node_modules/puppeteer/install.js", "fmt": "dprint fmt --config .github/config/dprint.json && npx eslint source/**/*.mjs --fix" diff --git a/source/.eslintrc.yml b/source/.eslintrc.yml index 6d23f3da..e36ce827 100644 --- a/source/.eslintrc.yml +++ b/source/.eslintrc.yml @@ -126,9 +126,9 @@ rules: func-call-spacing: error arrow-spacing: error generator-star-spacing: error - object-curly-spacing: [error, never] + object-curly-spacing: [warn, never] rest-spread-spacing: error - key-spacing: [error, {afterColon: false}] + key-spacing: [warn, {afterColon: false}] computed-property-spacing: error array-bracket-spacing: [error, never] no-whitespace-before-property: error