From 58f371f55ddca2138d7cfeb57849c8b29d3cf52c Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 14:48:55 +0100 Subject: [PATCH 01/11] add readmes, code of conduct and diagram to lint ignore file --- .eslintignore | 4 ++++ package.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index a7c722f8c5..3be8d12502 100644 --- a/.eslintignore +++ b/.eslintignore @@ -42,3 +42,7 @@ diagram.svg .env.* **/assets/*.js *.min.js +**/Readme.md +**/README.md +code-of-conduct.md +diagram.svg diff --git a/package.json b/package.json index 51c913108f..4709508ba5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "test": "npm run --workspaces test", "test:all": "npm run --workspaces --if-present test", "eslint": "npm --workspaces run eslint && npm run eslint:workspace", - "eslint:workspace": "npx eslint '.*.*' '*.*' .vscode .github --ignore-pattern README.md --ignore-pattern code-of-conduct.md --ignore-pattern diagram.svg --ignore-path .eslintignore --quiet", + "eslint:workspace": "npx eslint '.*.*' '*.*' .vscode .github --ignore-path .eslintignore --quiet", "eslint:contracts": "npm -w @prosopo/captcha-contract -w @prosopo/common-contract -w @prosopo/proxy-contract run eslint", "eslint:fix": "npm --workspaces run eslint:fix && npm run eslint:fix:workspace", "eslint:fix:workspace": "npm run eslint:workspace -- --fix", @@ -156,4 +156,4 @@ "web3-captcha" ], "license": "Apache-2.0" -} +} \ No newline at end of file From 78cc720f7f0a7a8e3182c82dc5385dbfaec32f9a Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 14:49:26 +0100 Subject: [PATCH 02/11] lint only files which have changed --- .github/workflows/lint.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index de99e475b5..efb4089aaa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -86,6 +86,11 @@ jobs: - run: npm ci - - run: npm run build -w @prosopo/scripts + - name: lint + run: | + # get the files which have changed in the PR + files=$(curl -L -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "${PR_URL}/files" | jq -r '.[] | .filename') - - run: npm run lint + # feed those files into eslint + prettier, as we only need to lint the files that have changed + npx eslint -- --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern $files + npx prettier -- --check --ignore-path .eslintignore --no-error-on-unmatched-pattern $files From db99476b9eba874c65405eaabff5009b19f2c6ab Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 14:51:59 +0100 Subject: [PATCH 03/11] add license linting back in --- .github/workflows/lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index efb4089aaa..625c8a2781 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -86,6 +86,11 @@ jobs: - run: npm ci + - run: npm -w @prosopo/scripts build + + - name: license + run: npm run -w @prosopo/scripts license + - name: lint run: | # get the files which have changed in the PR From 2a92304c0eae28bb4c88bc0b4efae252de6dc8e9 Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 15:02:45 +0100 Subject: [PATCH 04/11] typo --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 625c8a2781..db24c62e7e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -86,7 +86,7 @@ jobs: - run: npm ci - - run: npm -w @prosopo/scripts build + - run: npm run -w @prosopo/scripts build - name: license run: npm run -w @prosopo/scripts license From 93733629933952e6a9a25f7fed589ab3426c0a2a Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 15:23:47 +0100 Subject: [PATCH 05/11] reorder args --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index db24c62e7e..6dbcc31a9a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -97,5 +97,5 @@ jobs: files=$(curl -L -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "${PR_URL}/files" | jq -r '.[] | .filename') # feed those files into eslint + prettier, as we only need to lint the files that have changed - npx eslint -- --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern $files - npx prettier -- --check --ignore-path .eslintignore --no-error-on-unmatched-pattern $files + npx eslint -- $files --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern + npx prettier -- $files --check --ignore-path .eslintignore --no-error-on-unmatched-pattern From d91f77bf3ca1e0357576da7a0801caf01e3ec234 Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 16:09:41 +0100 Subject: [PATCH 06/11] debug files --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6dbcc31a9a..a288c7b3bb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -94,7 +94,9 @@ jobs: - name: lint run: | # get the files which have changed in the PR - files=$(curl -L -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "${PR_URL}/files" | jq -r '.[] | .filename') + files=$(curl -L -s -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${PR_URL}/files" | jq -r '.[] | .filename') + + echo "files: $files" # feed those files into eslint + prettier, as we only need to lint the files that have changed npx eslint -- $files --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern From 0f648ba23634c1a88e4826aea673b6029cc7c964 Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 21:16:37 +0100 Subject: [PATCH 07/11] missing line --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a288c7b3bb..f67d3867e4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -94,7 +94,7 @@ jobs: - name: lint run: | # get the files which have changed in the PR - files=$(curl -L -s -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${PR_URL}/files" | jq -r '.[] | .filename') + files=$(curl -L -s -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${{ github.event.pull_request.url }}/files" | jq -r '.[] | .filename') echo "files: $files" From a25f871155f85114c3ea9d21c1ef661c9ec3c7d8 Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 21:20:09 +0100 Subject: [PATCH 08/11] rearrange args for eslint and prettier --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f67d3867e4..871b4751f3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -99,5 +99,5 @@ jobs: echo "files: $files" # feed those files into eslint + prettier, as we only need to lint the files that have changed - npx eslint -- $files --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern - npx prettier -- $files --check --ignore-path .eslintignore --no-error-on-unmatched-pattern + npx eslint --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern -- $files + npx prettier --check --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files From 88d814ba2efe0c3ce6a3f4fa7614d731a9fd4644 Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 21:23:04 +0100 Subject: [PATCH 09/11] remove quiet parameter from eslint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 871b4751f3..e9bc978dd7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -99,5 +99,5 @@ jobs: echo "files: $files" # feed those files into eslint + prettier, as we only need to lint the files that have changed - npx eslint --ignore-path .eslintignore --quiet --no-error-on-unmatched-pattern -- $files + npx eslint --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files npx prettier --check --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files From e94d38a472e5d2379be31605a64f0b47cc01544c Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 21:23:40 +0100 Subject: [PATCH 10/11] lint --- .github/workflows/lint.yml | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e9bc978dd7..c362283e46 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -93,11 +93,11 @@ jobs: - name: lint run: | - # get the files which have changed in the PR - files=$(curl -L -s -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${{ github.event.pull_request.url }}/files" | jq -r '.[] | .filename') + # get the files which have changed in the PR + files=$(curl -L -s -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${{ github.event.pull_request.url }}/files" | jq -r '.[] | .filename') - echo "files: $files" + echo "files: $files" - # feed those files into eslint + prettier, as we only need to lint the files that have changed - npx eslint --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files - npx prettier --check --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files + # feed those files into eslint + prettier, as we only need to lint the files that have changed + npx eslint --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files + npx prettier --check --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files diff --git a/package.json b/package.json index 4709508ba5..d3c791ecef 100644 --- a/package.json +++ b/package.json @@ -156,4 +156,4 @@ "web3-captcha" ], "license": "Apache-2.0" -} \ No newline at end of file +} From e7a6f54c3d1ebef40f87f36ebe25426f277ca95f Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 21 May 2024 21:28:29 +0100 Subject: [PATCH 11/11] add eslintignore file to eslintignore file --- .eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintignore b/.eslintignore index 3be8d12502..1eae5f9641 100644 --- a/.eslintignore +++ b/.eslintignore @@ -46,3 +46,4 @@ diagram.svg **/README.md code-of-conduct.md diagram.svg +**/.eslintignore