From 735d5d3fa3aba2b84025afb74b88e8d4e5a19e59 Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:40:57 +0900 Subject: [PATCH 01/12] add config.yml --- .github/workflows/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/config.yml diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 0000000..73d8311 --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,15 @@ +name: actions + +on: [push] + +jobs: + build: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - name: Check all documents + run: | + ./bin/run-docker tensorflow/docs master result.txt + cat result.txt From 527157b4b7763055843a77cf7d2ae6ca4906d200 Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:41:23 +0900 Subject: [PATCH 02/12] rm --it option --- bin/run-docker | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/run-docker b/bin/run-docker index b11c21d..af23bb1 100755 --- a/bin/run-docker +++ b/bin/run-docker @@ -1,7 +1,6 @@ #!/bin/bash docker run \ - -it \ --rm \ -v $(PWD):/usr/local/documents \ tfug/proofreading \ From d042010483464c64abfd01a2752c7cafeec1a1cc Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:41:51 +0900 Subject: [PATCH 03/12] update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6308183..e8805c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Temporary directory to clone GitHub repository ghrepos +result.txt From bdd0cccf5674bc8a0e05d9e213181016c6bbf8d2 Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:43:52 +0900 Subject: [PATCH 04/12] update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 3ebc31b..505eed0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Proofreading for TensorFlow docs translation +![](https://github.com/tfug/proofreading/workflows/actions/badge.svg) + [tensorflow/docs](https://github.com/tensorflow/docs)の日本語訳の表記ゆれ等をチェックするツールです。 ## Usage @@ -31,6 +33,8 @@ If you would like to use Docker, you can also execute the proofreading as $ ./bin/run-docker tensorflow/docs master result.txt ``` +It use Docker image [tfug/proofreading](https://hub.docker.com/r/tfug/proofreading). + ## Why use RedPen? We are working on translation with more than one person. So It is expected that a lot of orthographical variants will occur. From 853f677e2173014e3ae9b8b712a1d79786f7c456 Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:45:49 +0900 Subject: [PATCH 05/12] PWD ==> pwd --- bin/run-check | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bin/run-check diff --git a/bin/run-check b/bin/run-check new file mode 100644 index 0000000..067a35b --- /dev/null +++ b/bin/run-check @@ -0,0 +1,7 @@ +#!/bin/bash +docker run \ +-it \ +--rm \ +-v $(pwd)/..:/usr/local/documents \ +tfug/proofreading \ +/bin/ash proofreading/proofreading.sh $@ From 3666bed3ef737a47502847455b5e6acc7cd2b86c Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:49:01 +0900 Subject: [PATCH 06/12] mistake --- bin/run-check | 7 ------- bin/run-docker | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 bin/run-check diff --git a/bin/run-check b/bin/run-check deleted file mode 100644 index 067a35b..0000000 --- a/bin/run-check +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -docker run \ --it \ ---rm \ --v $(pwd)/..:/usr/local/documents \ -tfug/proofreading \ -/bin/ash proofreading/proofreading.sh $@ diff --git a/bin/run-docker b/bin/run-docker index af23bb1..06a8bd8 100755 --- a/bin/run-docker +++ b/bin/run-docker @@ -2,6 +2,6 @@ docker run \ --rm \ - -v $(PWD):/usr/local/documents \ + -v $(pwd):/usr/local/documents \ tfug/proofreading \ /bin/ash ./bin/run ${1} ${2} ${3} From 6e0a607505359d0f49eedf898ec40096e59c5942 Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Sat, 23 Nov 2019 02:57:52 +0900 Subject: [PATCH 07/12] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 505eed0..b60860f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ If you would like to use Docker, you can also execute the proofreading as $ ./bin/run-docker tensorflow/docs master result.txt ``` -It use Docker image [tfug/proofreading](https://hub.docker.com/r/tfug/proofreading). +It uses Docker image [tfug/proofreading](https://hub.docker.com/r/tfug/proofreading). ## Why use RedPen? From 119fbacfed2c333f41bdade75364940895f1571e Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Mon, 23 Dec 2019 03:46:45 +0900 Subject: [PATCH 08/12] add badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 899c3f0..e63edfa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Proofreading for TensorFlow docs translation +![](https://github.com/tfug/proofreading/workflows/actions/badge.svg) + ## Description [tensorflow/docs](https://github.com/tensorflow/docs)の日本語訳の表記ゆれ等をチェックするツールです。 From ef384cb83d6e6084cc341371b4bd14a7726f59ba Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Mon, 23 Dec 2019 03:46:55 +0900 Subject: [PATCH 09/12] fix config.yml --- .github/workflows/config.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 73d8311..7db7b5b 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -5,11 +5,19 @@ on: [push] jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Check all documents - run: | - ./bin/run-docker tensorflow/docs master result.txt - cat result.txt + + - name: Checkout + uses: actions/checkout@v2 + + - name: Check diff + uses: docker://tfug/proofreading:latest + with: + args: ./bin/run tensorflow/docs master + + - name: Check all + uses: docker://tfug/proofreading:latest + with: + args: ./bin/run tensorflow/docs master all From 2a75b8b51fe6cfdbdf0ede98945c2cebe6c70f78 Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Mon, 23 Dec 2019 04:23:17 +0900 Subject: [PATCH 10/12] bugfix --- terminologies.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminologies.txt b/terminologies.txt index 548a46e..52a24d9 100644 --- a/terminologies.txt +++ b/terminologies.txt @@ -82,4 +82,4 @@ Eager実行 Eager Execution eager 実行 Eager Execution Eager 実行 Eager Execution 購買 勾配 -常套句 イディオム +常套句 イディオム From 7987029fc2d03081cc817f70cd02c63cd47db54a Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Mon, 3 Feb 2020 05:31:41 +0900 Subject: [PATCH 11/12] fix ci for new community translation repository --- .github/workflows/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 7db7b5b..87367a8 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -15,9 +15,9 @@ jobs: - name: Check diff uses: docker://tfug/proofreading:latest with: - args: ./bin/run tensorflow/docs master + args: ./bin/run tensorflow/docs-l10n master - name: Check all uses: docker://tfug/proofreading:latest with: - args: ./bin/run tensorflow/docs master all + args: ./bin/run tensorflow/docs-l10n master all From b1eb6ea0b85aee0a74f82ff8ab1cd6cd2bc2e6ba Mon Sep 17 00:00:00 2001 From: sfujiwara Date: Mon, 3 Feb 2020 06:03:44 +0900 Subject: [PATCH 12/12] option to set error limit --- .github/workflows/config.yml | 4 ++-- bin/run | 6 ++++-- bin/run-all | 2 +- bin/run-diff | 4 ++-- bin/run-docker | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 87367a8..b0255c9 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -15,9 +15,9 @@ jobs: - name: Check diff uses: docker://tfug/proofreading:latest with: - args: ./bin/run tensorflow/docs-l10n master + args: ./bin/run tensorflow/docs-l10n master 10 - name: Check all uses: docker://tfug/proofreading:latest with: - args: ./bin/run tensorflow/docs-l10n master all + args: ./bin/run tensorflow/docs-l10n master all 10 diff --git a/bin/run b/bin/run index e2c2371..840fce8 100755 --- a/bin/run +++ b/bin/run @@ -16,9 +16,9 @@ set -e # Check the number of arguments -if [ $# -lt 2 -o $# -gt 3 ]; then +if [ $# -lt 2 -o $# -gt 4 ]; then echo "Error: Invalid arguments" - echo "Usage: ./bin/run " + echo "Usage: ./bin/run " exit 1 fi @@ -27,12 +27,14 @@ export GITHUB_REPOSITORY_URL="https://github.com/${GITHUB_REPOSITORY}" export BRANCH=${2} TYPE=${3} export LOG_FILE=result.txt +export ERROR_LIMIT=${4:-1} # Show config echo "GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}" echo "GITHUB_REPOSITORY_URL: ${GITHUB_REPOSITORY_URL}" echo "BRANCH: ${BRANCH}" echo "LOG_FILE: ${LOG_FILE}" +echo "ERROR_LIMIT: ${ERROR_LIMIT}" echo "" export TEMP_DIR="ghrepos" diff --git a/bin/run-all b/bin/run-all index 6e282aa..6f6d043 100755 --- a/bin/run-all +++ b/bin/run-all @@ -22,5 +22,5 @@ echo "" >> "${LOG_FILE}" files=`find ${TEMP_DIR}/${GITHUB_REPOSITORY}/site/ja -type f | grep .md` for file in ${files}; do echo "[${file}]" >> "${LOG_FILE}" - redpen --result-format plain2 ${file} >> "${LOG_FILE}" + redpen --result-format plain2 --limit ${ERROR_LIMIT} ${file} >> "${LOG_FILE}" done diff --git a/bin/run-diff b/bin/run-diff index 2916ea8..92a152e 100755 --- a/bin/run-diff +++ b/bin/run-diff @@ -25,7 +25,7 @@ for file in ${diff_files}; do if [ ${file##*.} = "md" ]; then markdown=${TEMP_DIR}/${GITHUB_REPOSITORY}/${file} echo "[${markdown}]" >> "${LOG_FILE}" - redpen --result-format plain2 ${markdown} >> "${LOG_FILE}" + redpen --result-format plain2 ${markdown} --limit ${ERROR_LIMIT} >> "${LOG_FILE}" # The case diff file is notebook elif [ ${file##*.} = "ipynb" ]; then @@ -33,7 +33,7 @@ for file in ${diff_files}; do markdown=${TEMP_DIR}/${GITHUB_REPOSITORY}/${file%.ipynb}.md jupyter nbconvert --to markdown ${notebook} echo "[${markdown}]" >> "${LOG_FILE}" - redpen --result-format plain2 ${markdown} >> "${LOG_FILE}" + redpen --result-format plain2 ${markdown} --limit ${ERROR_LIMIT} >> "${LOG_FILE}" fi done diff --git a/bin/run-docker b/bin/run-docker index 06a8bd8..93bfdb0 100755 --- a/bin/run-docker +++ b/bin/run-docker @@ -4,4 +4,4 @@ docker run \ --rm \ -v $(pwd):/usr/local/documents \ tfug/proofreading \ - /bin/ash ./bin/run ${1} ${2} ${3} + /bin/ash ./bin/run $@