From a628fde2abd8ed8f8cd84e0bf5415e4d3ec43298 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 10:27:38 +0200 Subject: [PATCH 01/28] unicode check action --- .gitea/workflows/unicode_check.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .gitea/workflows/unicode_check.yaml diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml new file mode 100644 index 0000000..a49c83b --- /dev/null +++ b/.gitea/workflows/unicode_check.yaml @@ -0,0 +1,22 @@ +--- +name: Check for disallowed chars + +on: + pull_request: + +jobs: + unicode-check: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: false + + - name: Check for disallowed chars + run: | + set -x + modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') + num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) + if [ $num -gt 0 ] ; then exit 1 ; done -- 2.45.2 From bfb4325d92d4101831ff12f0c3fc50f14ed24a4d Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 10:55:12 +0200 Subject: [PATCH 02/28] added complete checkout --- .gitea/workflows/unicode_check.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index a49c83b..d08d48a 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -11,8 +11,6 @@ jobs: image: catthehacker/ubuntu:act-latest steps: - uses: actions/checkout@v4 - with: - submodules: false - name: Check for disallowed chars run: | -- 2.45.2 From c97d6dc4b751962c855c0b967b7dac9ebb0721c4 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 12:58:52 +0200 Subject: [PATCH 03/28] test --- .gitea/workflows/unicode_check.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index d08d48a..66dda68 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -11,6 +11,8 @@ jobs: image: catthehacker/ubuntu:act-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 2 - name: Check for disallowed chars run: | -- 2.45.2 From 212dd1e0d256f1f217c4535b143a0f6a9a02eb0a Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:09:37 +0200 Subject: [PATCH 04/28] test1 --- .gitea/workflows/unicode_check.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 66dda68..c5ec1eb 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -17,6 +17,9 @@ jobs: - name: Check for disallowed chars run: | set -x + pwd + ls -la + ls -la content/ modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) if [ $num -gt 0 ] ; then exit 1 ; done -- 2.45.2 From 6aa4bb0eeed72c7c0d28a656e2b1574932c49a11 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:13:06 +0200 Subject: [PATCH 05/28] test2 --- .gitea/workflows/unicode_check.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index c5ec1eb..06953b6 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -17,9 +17,7 @@ jobs: - name: Check for disallowed chars run: | set -x - pwd - ls -la - ls -la content/ + git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short $@ modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) if [ $num -gt 0 ] ; then exit 1 ; done -- 2.45.2 From aa43a0c7770f61eaa73fcc7b6097ca2ee7fb6d38 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:22:44 +0200 Subject: [PATCH 06/28] test3 --- .gitea/workflows/unicode_check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 06953b6..5071807 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + ref: ${{github.event.pull_request.head.ref}} fetch-depth: 2 - name: Check for disallowed chars -- 2.45.2 From 4491cef86f911f4628225bb2a80ea4fa15398feb Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:25:48 +0200 Subject: [PATCH 07/28] test4 --- .gitea/workflows/unicode_check.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 5071807..17fb47d 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -12,8 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{github.event.pull_request.head.ref}} - fetch-depth: 2 + fetch-depth: 0 - name: Check for disallowed chars run: | -- 2.45.2 From c2cb3c45ef60744b47ab2071e0f7e22e0a1596dc Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:34:29 +0200 Subject: [PATCH 08/28] test 4a --- content/delme.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 content/delme.md diff --git a/content/delme.md b/content/delme.md new file mode 100644 index 0000000..e674cf6 --- /dev/null +++ b/content/delme.md @@ -0,0 +1,5 @@ +--- +title: no +--- + +invalid char: `’` -- 2.45.2 From 49a4d518633511e62254dd858fe98c1c3e1a6dd2 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:38:39 +0200 Subject: [PATCH 09/28] test5 --- .gitea/workflows/unicode_check.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 17fb47d..9e72f7f 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -20,4 +20,6 @@ jobs: git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short $@ modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - if [ $num -gt 0 ] ; then exit 1 ; done + echo "modifiche: $modifiche" + echo "num: $num" + if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done -- 2.45.2 From 487ce7cf811f79fa919a0796258cbd241bef9a1a Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 13:41:38 +0200 Subject: [PATCH 10/28] test 6 --- .gitea/workflows/unicode_check.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 9e72f7f..45fd573 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -16,8 +16,6 @@ jobs: - name: Check for disallowed chars run: | - set -x - git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short $@ modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) echo "modifiche: $modifiche" -- 2.45.2 From 0f5b6b0c9c8aa78330267d3a4f3f87add5ca2685 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 18:19:23 +0200 Subject: [PATCH 11/28] test 7 --- .gitea/workflows/unicode_check.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 45fd573..187761b 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -16,8 +16,10 @@ jobs: - name: Check for disallowed chars run: | + set -x modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) + if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done + echo "modifiche: $modifiche" echo "num: $num" - if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done -- 2.45.2 From 53746f702aa53dc16fa7a863e31d1aedaee15183 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 4 Aug 2024 18:23:32 +0200 Subject: [PATCH 12/28] test 8 --- .gitea/workflows/unicode_check.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 187761b..905d395 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -15,11 +15,13 @@ jobs: fetch-depth: 0 - name: Check for disallowed chars + shell: bash run: | set -x modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done echo "modifiche: $modifiche" echo "num: $num" + exit 0 + if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done -- 2.45.2 From fd534255713f237baa14dcf52942d932ec03bd2f Mon Sep 17 00:00:00 2001 From: paspo Date: Mon, 5 Aug 2024 21:06:16 +0200 Subject: [PATCH 13/28] test9 --- .gitea/workflows/unicode_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 905d395..397c119 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -19,7 +19,7 @@ jobs: run: | set -x modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') - num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) + num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) echo "modifiche: $modifiche" echo "num: $num" -- 2.45.2 From c86193945bd219b10fbe0215cbdf3fc9e513783b Mon Sep 17 00:00:00 2001 From: paspo Date: Mon, 5 Aug 2024 21:12:56 +0200 Subject: [PATCH 14/28] test10 --- .gitea/workflows/unicode_check.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 397c119..1633714 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -18,10 +18,8 @@ jobs: shell: bash run: | set -x - modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - echo "modifiche: $modifiche" echo "num: $num" exit 0 if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done -- 2.45.2 From f3211ec8612890c3ab7d71dd4a74fac65abf8861 Mon Sep 17 00:00:00 2001 From: paspo Date: Mon, 5 Aug 2024 21:28:20 +0200 Subject: [PATCH 15/28] test11 --- .gitea/workflows/unicode_check.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 1633714..048070a 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -19,7 +19,6 @@ jobs: run: | set -x num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - - echo "num: $num" - exit 0 - if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done + if (( $num -gt 0 )) ; then + exit 1 + fi -- 2.45.2 From 55ebacd78d0e1244db5654cc1daa71a229450d4c Mon Sep 17 00:00:00 2001 From: paspo Date: Mon, 5 Aug 2024 21:32:12 +0200 Subject: [PATCH 16/28] test12 --- .gitea/workflows/unicode_check.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 048070a..e1301b7 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -15,10 +15,11 @@ jobs: fetch-depth: 0 - name: Check for disallowed chars - shell: bash run: | set -x num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - if (( $num -gt 0 )) ; then + if [ "$num" = "0" ] ; then + exit 0 + else exit 1 fi -- 2.45.2 From 8e424fe5cfa3ddb16c0bc7dd34e914fb192c28d5 Mon Sep 17 00:00:00 2001 From: paspo Date: Mon, 5 Aug 2024 21:55:59 +0200 Subject: [PATCH 17/28] test13 --- .gitea/workflows/unicode_check.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index e1301b7..8f5ef95 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -16,10 +16,8 @@ jobs: - name: Check for disallowed chars run: | - set -x num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - if [ "$num" = "0" ] ; then - exit 0 - else - exit 1 + echo "::debug::Occorrenze: $num" + if [ ! "$num" = "0" ] ; then + echo "::error trovate $num occorrenze di caratteri non permessi" fi -- 2.45.2 From b43ee99f652955c9fdc6852642bada287a0a6ccc Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 7 Aug 2024 21:15:41 +0200 Subject: [PATCH 18/28] test14 --- .gitea/workflows/unicode_check.yaml | 28 +++++++++++++++++++++++----- .markdownlint.yaml | 6 ++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 .markdownlint.yaml diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 8f5ef95..70a7a80 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -15,9 +15,27 @@ jobs: fetch-depth: 0 - name: Check for disallowed chars + id: file-lister run: | - num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - echo "::debug::Occorrenze: $num" - if [ ! "$num" = "0" ] ; then - echo "::error trovate $num occorrenze di caratteri non permessi" - fi + echo "FILELIST=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ )" >> "$GITHUB_OUTPUT" + + - name: markdownlint-cli + # env: + # FILELIST: ${{ steps.file-lister.outputs.FILELIST }} + uses: nosborn/github-action-markdown-cli@v3.3.0 + with: + files: ${{ steps.file-lister.outputs.FILELIST }} + config_file: .markdownlint.yaml + dot: false + # rules: examples/rules/custom.js + + + # num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) + # echo "::debug::Occorrenze: $num" + # if [ ! "$num" = "0" ] ; then + # echo "::error trovate $num occorrenze di caratteri non permessi" + # fi + + + +# git diff --name-only e2ec2669247fb8a6643e6456205a0faf821156de 55ebacd78d0e1244db5654cc1daa71a229450d4c content/ diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..42d7f74 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +--- +default: true +MD013: false + +# MD013: { stern: true } +# MD024: { siblings_only: true } -- 2.45.2 From a2f52db0e52618dd4d0140c8221ac95dea16a52d Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 7 Aug 2024 21:23:38 +0200 Subject: [PATCH 19/28] test15 --- .gitea/workflows/unicode_check.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 70a7a80..d9992e3 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -14,10 +14,15 @@ jobs: with: fetch-depth: 0 - - name: Check for disallowed chars + - name: Getting changed files id: file-lister run: | - echo "FILELIST=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ )" >> "$GITHUB_OUTPUT" + echo "Initial commit: ${{ github.event.pull_request.base.sha }}" + echo "Final commit: ${{ github.event.pull_request.head.sha }}" + F=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$ ) + echo "File list:" + echo "$F" + echo "FILELIST=$F" >> "$GITHUB_OUTPUT" - name: markdownlint-cli # env: -- 2.45.2 From ff713a1e8260aa5fe92efd8a8fe7acf3c5b27410 Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 7 Aug 2024 21:56:29 +0200 Subject: [PATCH 20/28] test 16 --- .markdownlint.yaml | 3 ++- content/delme2.md | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 content/delme2.md diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 42d7f74..b61c146 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,6 +1,7 @@ --- default: true -MD013: false +MD013: + line_length: 80 # MD013: { stern: true } # MD024: { siblings_only: true } diff --git a/content/delme2.md b/content/delme2.md new file mode 100644 index 0000000..ced5c41 --- /dev/null +++ b/content/delme2.md @@ -0,0 +1,9 @@ +--- +title: no +--- + +invalid char: `’` + +asd’asd + +asdaksjdlaj slkas jdlkajs ldkasj lkasj dlkasjdlk ajsldkajs dlkjasklsaj lkaj sldkj lkej lkeajf alsdkjf asldkfj -- 2.45.2 From 529cf0c0f6ae8f45ff81a1eca97730c620225aa6 Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 7 Aug 2024 22:25:28 +0200 Subject: [PATCH 21/28] test 17 --- .gitea/workflows/unicode_check.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index d9992e3..8fa9ae4 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -16,20 +16,23 @@ jobs: - name: Getting changed files id: file-lister + shell: bash run: | echo "Initial commit: ${{ github.event.pull_request.base.sha }}" echo "Final commit: ${{ github.event.pull_request.head.sha }}" - F=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$ ) + while read LINE; do + F="$F \"${LINE}\"" + done < <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$) echo "File list:" echo "$F" echo "FILELIST=$F" >> "$GITHUB_OUTPUT" - - name: markdownlint-cli + - name: Markdown Lint # env: # FILELIST: ${{ steps.file-lister.outputs.FILELIST }} uses: nosborn/github-action-markdown-cli@v3.3.0 with: - files: ${{ steps.file-lister.outputs.FILELIST }} + files: "${{ steps.file-lister.outputs.FILELIST }}" config_file: .markdownlint.yaml dot: false # rules: examples/rules/custom.js -- 2.45.2 From 7eeb1c726bbb72fb2d56b4d1adcb8b5ac6dff020 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 8 Aug 2024 19:46:17 +0200 Subject: [PATCH 22/28] test 18 --- .gitea/workflows/unicode_check.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 8fa9ae4..bf8aa3b 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -27,6 +27,14 @@ jobs: echo "$F" echo "FILELIST=$F" >> "$GITHUB_OUTPUT" + - name: Check check check + shell: bash + env: + FILELIST: ${{ steps.file-lister.outputs.FILELIST }} + run: | + echo FILELIST: + echo $FILELIST + - name: Markdown Lint # env: # FILELIST: ${{ steps.file-lister.outputs.FILELIST }} -- 2.45.2 From 2ed4bf56bfcd74b576dd1833a5318ceb02287d82 Mon Sep 17 00:00:00 2001 From: paspo Date: Thu, 8 Aug 2024 20:25:26 +0200 Subject: [PATCH 23/28] test 19 --- .gitea/workflows/unicode_check.yaml | 35 ++++++++--------------------- content/delme anche.md | 11 +++++++++ 2 files changed, 20 insertions(+), 26 deletions(-) create mode 100644 content/delme anche.md diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index bf8aa3b..47e7aa3 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -20,38 +20,21 @@ jobs: run: | echo "Initial commit: ${{ github.event.pull_request.base.sha }}" echo "Final commit: ${{ github.event.pull_request.head.sha }}" - while read LINE; do - F="$F \"${LINE}\"" - done < <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$) echo "File list:" - echo "$F" + while read LINE; do + echo $LINE + LINASDASDSAE=$(printf %q "$LINE") + F="$F $(echo "${LINE}"|sed 's/\ /\\ /')" + done < <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$) echo "FILELIST=$F" >> "$GITHUB_OUTPUT" - - name: Check check check - shell: bash + - name: Markdown Lint env: FILELIST: ${{ steps.file-lister.outputs.FILELIST }} - run: | - echo FILELIST: - echo $FILELIST - - - name: Markdown Lint - # env: - # FILELIST: ${{ steps.file-lister.outputs.FILELIST }} uses: nosborn/github-action-markdown-cli@v3.3.0 with: - files: "${{ steps.file-lister.outputs.FILELIST }}" + files: "${{ env.FILELIST }}" + # entrypoint: /bin/sh + # args: -c 'set' config_file: .markdownlint.yaml dot: false - # rules: examples/rules/custom.js - - - # num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) - # echo "::debug::Occorrenze: $num" - # if [ ! "$num" = "0" ] ; then - # echo "::error trovate $num occorrenze di caratteri non permessi" - # fi - - - -# git diff --name-only e2ec2669247fb8a6643e6456205a0faf821156de 55ebacd78d0e1244db5654cc1daa71a229450d4c content/ diff --git a/content/delme anche.md b/content/delme anche.md new file mode 100644 index 0000000..1ccea77 --- /dev/null +++ b/content/delme anche.md @@ -0,0 +1,11 @@ +--- +title: no +--- + +invalid char: `’` + +asd’asd + +asdaksjdlaj slkas jdlkajs ldkasj lkasj dlkasjdlk ajsldkajs dlkjasklsaj lkaj sldkj lkej lkeajf alsdkjf asldkfj +anche!!! + -- 2.45.2 From d1de07df2fb5d88a043102de8f192d2cbc03b005 Mon Sep 17 00:00:00 2001 From: paspo Date: Fri, 9 Aug 2024 21:34:25 +0200 Subject: [PATCH 24/28] test 20 --- .gitea/workflows/markdownlint_pr.sh | 9 +++++ .gitea/workflows/unicode_check.yaml | 52 ++++++++++++++++------------- 2 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 .gitea/workflows/markdownlint_pr.sh diff --git a/.gitea/workflows/markdownlint_pr.sh b/.gitea/workflows/markdownlint_pr.sh new file mode 100644 index 0000000..84f6353 --- /dev/null +++ b/.gitea/workflows/markdownlint_pr.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "Initial commit: $1" +echo "Final commit: $2" +echo "File list:" +while read -r LINE; do + echo "$LINE" + mdl --config .markdownlint.yaml "$LINE" +done < <(git diff --name-only $1 $2 content/ | grep \.md$) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 47e7aa3..8dc7f5f 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -14,27 +14,33 @@ jobs: with: fetch-depth: 0 - - name: Getting changed files - id: file-lister - shell: bash - run: | - echo "Initial commit: ${{ github.event.pull_request.base.sha }}" - echo "Final commit: ${{ github.event.pull_request.head.sha }}" - echo "File list:" - while read LINE; do - echo $LINE - LINASDASDSAE=$(printf %q "$LINE") - F="$F $(echo "${LINE}"|sed 's/\ /\\ /')" - done < <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$) - echo "FILELIST=$F" >> "$GITHUB_OUTPUT" - - - name: Markdown Lint - env: - FILELIST: ${{ steps.file-lister.outputs.FILELIST }} - uses: nosborn/github-action-markdown-cli@v3.3.0 + - name: vai + uses: docker://registry.gitlab.com/pipeline-components/markdownlint:latest with: - files: "${{ env.FILELIST }}" - # entrypoint: /bin/sh - # args: -c 'set' - config_file: .markdownlint.yaml - dot: false + entrypoint: /bin/sh + args: -c 'apk -U add bash ; bash .gitea/workflows/markdownlint_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}' + + # - name: Getting changed files + # id: file-lister + # shell: bash + # run: | + # echo "Initial commit: ${{ github.event.pull_request.base.sha }}" + # echo "Final commit: ${{ github.event.pull_request.head.sha }}" + # echo "File list:" + # while read LINE; do + # echo $LINE + # LINASDASDSAE=$(printf %q "$LINE") + # F="$F $(echo "${LINE}"|sed 's/\ /\\ /')" + # done < <(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep \.md$) + # echo "FILELIST=$F" >> "$GITHUB_OUTPUT" + + # - name: Markdown Lint + # env: + # FILELIST: ${{ steps.file-lister.outputs.FILELIST }} + # uses: nosborn/github-action-markdown-cli@v3.3.0 + # with: + # files: "${{ env.FILELIST }}" + # # entrypoint: /bin/sh + # # args: -c 'set' + # config_file: .markdownlint.yaml + # dot: false -- 2.45.2 From 2d973212d8ea23e5ea62e64b1dedc89d52f333bf Mon Sep 17 00:00:00 2001 From: paspo Date: Fri, 9 Aug 2024 21:49:31 +0200 Subject: [PATCH 25/28] test 21 --- .gitea/workflows/markdownlint_pr.sh | 4 ++-- .markdownlint.yaml | 4 ++-- content/delme anche.md | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/markdownlint_pr.sh b/.gitea/workflows/markdownlint_pr.sh index 84f6353..e0c4909 100644 --- a/.gitea/workflows/markdownlint_pr.sh +++ b/.gitea/workflows/markdownlint_pr.sh @@ -2,8 +2,8 @@ echo "Initial commit: $1" echo "Final commit: $2" -echo "File list:" +echo "" while read -r LINE; do - echo "$LINE" + echo "" mdl --config .markdownlint.yaml "$LINE" done < <(git diff --name-only $1 $2 content/ | grep \.md$) diff --git a/.markdownlint.yaml b/.markdownlint.yaml index b61c146..305c264 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,7 +1,7 @@ --- default: true -MD013: - line_length: 80 +MD013: false + # line_length: 8000 # MD013: { stern: true } # MD024: { siblings_only: true } diff --git a/content/delme anche.md b/content/delme anche.md index 1ccea77..36213d2 100644 --- a/content/delme anche.md +++ b/content/delme anche.md @@ -8,4 +8,3 @@ asd’asd asdaksjdlaj slkas jdlkajs ldkasj lkasj dlkasjdlk ajsldkajs dlkjasklsaj lkaj sldkj lkej lkeajf alsdkjf asldkfj anche!!! - -- 2.45.2 From 261b1604a19b11e940c7a91621ec5d6e8af26e99 Mon Sep 17 00:00:00 2001 From: paspo Date: Fri, 9 Aug 2024 22:25:51 +0200 Subject: [PATCH 26/28] test 22 --- .gitea/workflows/markdownlint_pr.sh | 15 +++++++++++---- .gitea/workflows/unicode_check.yaml | 4 ++-- .markdownlint.yaml | 7 ++----- content/delme anche.md | 1 + 4 files changed, 16 insertions(+), 11 deletions(-) mode change 100644 => 100755 .gitea/workflows/markdownlint_pr.sh diff --git a/.gitea/workflows/markdownlint_pr.sh b/.gitea/workflows/markdownlint_pr.sh old mode 100644 new mode 100755 index e0c4909..d0fc1fd --- a/.gitea/workflows/markdownlint_pr.sh +++ b/.gitea/workflows/markdownlint_pr.sh @@ -1,9 +1,16 @@ #!/bin/bash +echo echo "Initial commit: $1" echo "Final commit: $2" -echo "" +echo + +# recupera ogni file modificato in questa PR (tra le 2 commit) +# considera solo i file che terminano con .md +# ogni file viene controllato con markdownlint, con la config comune + while read -r LINE; do - echo "" - mdl --config .markdownlint.yaml "$LINE" -done < <(git diff --name-only $1 $2 content/ | grep \.md$) + echo + echo "testing file: $LINE" + markdownlint --config .markdownlint.yaml "$LINE" +done < <(git diff --name-only "$1" "$2" content/ | grep \.md$) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index 8dc7f5f..c94dad3 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -15,10 +15,10 @@ jobs: fetch-depth: 0 - name: vai - uses: docker://registry.gitlab.com/pipeline-components/markdownlint:latest + uses: docker://ghcr.io/igorshubovych/markdownlint-cli with: entrypoint: /bin/sh - args: -c 'apk -U add bash ; bash .gitea/workflows/markdownlint_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}' + args: -c 'apk -U add git bash ; bash .gitea/workflows/markdownlint_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}' # - name: Getting changed files # id: file-lister diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 305c264..c0f2752 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,7 +1,4 @@ ---- +# vedi: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml + default: true MD013: false - # line_length: 8000 - -# MD013: { stern: true } -# MD024: { siblings_only: true } diff --git a/content/delme anche.md b/content/delme anche.md index 36213d2..f94f957 100644 --- a/content/delme anche.md +++ b/content/delme anche.md @@ -6,5 +6,6 @@ invalid char: `’` asd’asd + asdaksjdlaj slkas jdlkajs ldkasj lkasj dlkasjdlk ajsldkajs dlkjasklsaj lkaj sldkj lkej lkeajf alsdkjf asldkfj anche!!! -- 2.45.2 From 26baf86c871db5472dc8a1fac5a5036009c45af1 Mon Sep 17 00:00:00 2001 From: paspo Date: Sat, 10 Aug 2024 12:00:45 +0200 Subject: [PATCH 27/28] test 23 --- .gitea/workflows/markdownlint_pr.sh | 6 +++++- content/delme anche.md | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/markdownlint_pr.sh b/.gitea/workflows/markdownlint_pr.sh index d0fc1fd..62a68de 100755 --- a/.gitea/workflows/markdownlint_pr.sh +++ b/.gitea/workflows/markdownlint_pr.sh @@ -9,8 +9,12 @@ echo # considera solo i file che terminano con .md # ogni file viene controllato con markdownlint, con la config comune +EXIT=0 + while read -r LINE; do echo echo "testing file: $LINE" - markdownlint --config .markdownlint.yaml "$LINE" + markdownlint --config .markdownlint.yaml "$LINE" || EXIT=1 done < <(git diff --name-only "$1" "$2" content/ | grep \.md$) + +exit ${EXIT} diff --git a/content/delme anche.md b/content/delme anche.md index f94f957..36213d2 100644 --- a/content/delme anche.md +++ b/content/delme anche.md @@ -6,6 +6,5 @@ invalid char: `’` asd’asd - asdaksjdlaj slkas jdlkajs ldkasj lkasj dlkasjdlk ajsldkajs dlkjasklsaj lkaj sldkj lkej lkeajf alsdkjf asldkfj anche!!! -- 2.45.2 From 14c30347322a3649a3c1501d156b618395db56ba Mon Sep 17 00:00:00 2001 From: paspo Date: Sat, 10 Aug 2024 13:39:06 +0200 Subject: [PATCH 28/28] unwanted unicode --- .gitea/workflows/unicode_check.yaml | 5 ++++ .../workflows/unwanted_unicode_patterns.grep | 6 +++++ .gitea/workflows/unwanted_unicode_pr.sh | 23 +++++++++++++++++++ content/{delme anche.md => delme anche.mda} | 0 content/{delme.md => delme.mda} | 0 content/{delme2.md => delme2.mda} | 0 6 files changed, 34 insertions(+) create mode 100644 .gitea/workflows/unwanted_unicode_patterns.grep create mode 100755 .gitea/workflows/unwanted_unicode_pr.sh rename content/{delme anche.md => delme anche.mda} (100%) rename content/{delme.md => delme.mda} (100%) rename content/{delme2.md => delme2.mda} (100%) diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml index c94dad3..94542fa 100644 --- a/.gitea/workflows/unicode_check.yaml +++ b/.gitea/workflows/unicode_check.yaml @@ -20,6 +20,11 @@ jobs: entrypoint: /bin/sh args: -c 'apk -U add git bash ; bash .gitea/workflows/markdownlint_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}' + - name: check for unwanted unicode runes + run: | + bash .gitea/workflows/unwanted_unicode_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} + + # - name: Getting changed files # id: file-lister # shell: bash diff --git a/.gitea/workflows/unwanted_unicode_patterns.grep b/.gitea/workflows/unwanted_unicode_patterns.grep new file mode 100644 index 0000000..2447505 --- /dev/null +++ b/.gitea/workflows/unwanted_unicode_patterns.grep @@ -0,0 +1,6 @@ +— +‘ +’ +“ +” +… diff --git a/.gitea/workflows/unwanted_unicode_pr.sh b/.gitea/workflows/unwanted_unicode_pr.sh new file mode 100755 index 0000000..e00ee2e --- /dev/null +++ b/.gitea/workflows/unwanted_unicode_pr.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo +echo "Initial commit: $1" +echo "Final commit: $2" +echo + +# recupera ogni file modificato in questa PR (tra le 2 commit) +# considera solo i file che terminano con .md +# ogni file viene controllato con grep, con i pattern definiti +# nel file di configurazione + +EXIT=0 + +while read -r LINE; do + if [ -r "$LINE" ] ; then + echo + echo "testing file: $LINE" + grep --color -f .gitea/workflows/unwanted_unicode_patterns.grep "$LINE" && EXIT=1 + fi +done < <(git diff --name-only "$1" "$2" content/ | grep \.md$) + +exit ${EXIT} diff --git a/content/delme anche.md b/content/delme anche.mda similarity index 100% rename from content/delme anche.md rename to content/delme anche.mda diff --git a/content/delme.md b/content/delme.mda similarity index 100% rename from content/delme.md rename to content/delme.mda diff --git a/content/delme2.md b/content/delme2.mda similarity index 100% rename from content/delme2.md rename to content/delme2.mda -- 2.45.2