From ba9e6f0c5cdacd9299141e5735c2f8d68e78578d Mon Sep 17 00:00:00 2001 From: spacewander Date: Mon, 19 Jun 2023 21:51:53 +0800 Subject: [PATCH] Add typo checker --- .github/.ignore_words | 1 + .github/workflows/ci.yml | 20 ++++++++-- Commands.md | 4 +- bin/git-clear-soft | 4 +- bin/git-standup | 2 +- bin/git-summary | 2 +- man/git-magic.1 | 6 +-- man/git-magic.html | 6 +-- man/git-magic.md | 2 +- man/git-summary.1 | 81 +++++----------------------------------- man/git-summary.html | 59 +++++++++++++++-------------- man/git-summary.md | 11 +++--- 12 files changed, 75 insertions(+), 123 deletions(-) create mode 100644 .github/.ignore_words diff --git a/.github/.ignore_words b/.github/.ignore_words new file mode 100644 index 0000000..8aad33d --- /dev/null +++ b/.github/.ignore_words @@ -0,0 +1 @@ +gool diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e987642..f7e84d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,17 @@ on: branches: [master] jobs: lint: - runs-on: 'ubuntu-22.04' + runs-on: 'ubuntu-latest' steps: - name: 'Get Changed Files' id: 'files' uses: 'masesgroup/retrieve-changed-files@v2' with: format: 'json' + # a force push will cause the action above to fail. Don't do force push when people are + # reviewing! - name: Check out code. - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: 'Check EditorConfig Lint' run: | sudo apt install -y jq golang @@ -23,17 +25,27 @@ jobs: readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')" ~/go/bin/editorconfig-checker ${changed_files[@]} + typo: + runs-on: ubuntu-latest + steps: + - name: Check out code. + uses: actions/checkout@v3 + - name: spell check + run: | + pip install codespell==2.2 + git grep --cached -l '' | grep -v -e 'History\.md' -e 'AUTHORS' -e 'man/.*\.1' -e 'man/.*\.html' | xargs codespell --ignore-words=.github/.ignore_words + build: strategy: fail-fast: false matrix: platform: - - ubuntu-22.04 + - ubuntu-latest - macos-latest runs-on: ${{ matrix.platform }} steps: - name: Check out code. - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Linux Install if: matrix.platform == 'ubuntu-22.04' run: | diff --git a/Commands.md b/Commands.md index c5be97d..904b788 100644 --- a/Commands.md +++ b/Commands.md @@ -176,8 +176,8 @@ authors : 1 Guillermo Rauch 0.6% ``` -This command can also take a *commitish*, and will print a summary for commits in -the commitish range: +This command can also take a *committish*, and will print a summary for commits in +the committish range: ```bash $ git summary v42.. diff --git a/bin/git-clear-soft b/bin/git-clear-soft index 9cc70fa..0473b57 100755 --- a/bin/git-clear-soft +++ b/bin/git-clear-soft @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo -n "Sure? - This command may delete files that cannot be recovered. Files and directories in .gitignore will be preserved [y/N]: " -read -r ans -if [ "$ans" == "y" ] +read -r answer +if [ "$answer" == "y" ] then git clean -d -f && git reset --hard fi diff --git a/bin/git-standup b/bin/git-standup index be6b198..71653be 100755 --- a/bin/git-standup +++ b/bin/git-standup @@ -227,7 +227,7 @@ git_output() { echo "" fi fi - # TODO optimize:return if the latest commit of a branch is eariler than the 'since' day + # TODO optimize:return if the latest commit of a branch is earlier than the 'since' day done else # shellcheck disable=SC2086 diff --git a/bin/git-summary b/bin/git-summary index 6679c90..ddb72cd 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -195,7 +195,7 @@ uncommitted_changes_count() { } -COLUMN_CMD_DELIMTER="¬" # Hopefully, this symbol is not used in branch names... I use it as a seperator for columns +COLUMN_CMD_DELIMTER="¬" # Hopefully, this symbol is not used in branch names... I use it as a separator for columns SP="$COLUMN_CMD_DELIMTER|" print_summary_by_line() { diff --git a/man/git-magic.1 b/man/git-magic.1 index 5978a30..f2b1b48 100644 --- a/man/git-magic.1 +++ b/man/git-magic.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-MAGIC" "1" "October 2021" "" "Git Extras" +.TH "GIT\-MAGIC" "1" "May 2023" "" "Git Extras" . .SH "NAME" \fBgit\-magic\fR \- Automate add/commit/push routines @@ -10,7 +10,7 @@ \fBgit\-magic\fR [\-a] [\-m \fImsg\fR] [\-e] [\-p] [\-f] . .SH "DESCRIPTION" -Produces summary of changes for commit message from \fBgit status \-\-porcelain\fR output\. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally\. Also staging and pushing can be automated optinally\. +Produces summary of changes for commit message from \fBgit status \-\-porcelain\fR output\. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally\. Also staging and pushing can be automated optionally\. . .SH "OPTIONS" \-a @@ -93,7 +93,7 @@ Date: Thu Sep 30 20:14:22 2021 +0300 .IP "" 0 . .SH "AUTHOR" -Written by Alper S\. Soylu \fI54alpersaid@gmail\.com\fR +Written by Alper S\. Soylu <54alpersaid@gmail\.com> . .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> diff --git a/man/git-magic.html b/man/git-magic.html index f81b992..90d668e 100644 --- a/man/git-magic.html +++ b/man/git-magic.html @@ -83,7 +83,7 @@

Produces summary of changes for commit message from git status --porcelain output. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally. -Also staging and pushing can be automated optinally.

+Also staging and pushing can be automated optionally.

OPTIONS

@@ -145,7 +145,7 @@ Date: Thu Sep 30 20:14:22 2021 +0300

AUTHOR

-

Written by Alper S. Soylu 54alpersaid@gmail.com

+

Written by Alper S. Soylu <54alpersaid@gmail.com>

REPORTING BUGS

@@ -158,7 +158,7 @@ Date: Thu Sep 30 20:14:22 2021 +0300
  1. -
  2. October 2021
  3. +
  4. May 2023
  5. git-magic(1)
diff --git a/man/git-magic.md b/man/git-magic.md index e915381..8da5878 100644 --- a/man/git-magic.md +++ b/man/git-magic.md @@ -10,7 +10,7 @@ git-magic(1) -- Automate add/commit/push routines Produces summary of changes for commit message from `git status --porcelain` output. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally. -Also staging and pushing can be automated optinally. +Also staging and pushing can be automated optionally. ## OPTIONS diff --git a/man/git-summary.1 b/man/git-summary.1 index 8fbacd6..87a3085 100644 --- a/man/git-summary.1 +++ b/man/git-summary.1 @@ -1,86 +1,58 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "GIT\-SUMMARY" "1" "February 2023" "" "Git Extras" -. +.\" generated with Ronn-NG/v0.9.1 +.\" http://github.com/apjanke/ronn-ng/tree/0.9.1 +.TH "GIT\-SUMMARY" "1" "June 2023" "" "Git Extras" .SH "NAME" \fBgit\-summary\fR \- Show repository summary -. .SH "SYNOPSIS" \fBgit\-summary\fR [\-\-dedup\-by\-email] [\-\-no\-merges] [] -. -.br +.P \fBgit\-summary\fR \-\-line [] -. .SH "DESCRIPTION" Shows a summary of the repository or a path within it\. -. .SH "OPTIONS" -. .P Summarize only the range of commits included in the \. -. .P -. .P Summarize only the range of files included in the \. -. .P \-\-dedup\-by\-email -. .P Remove duplicate authors who belong to the same email address\. For example, -. .IP "" 4 -. .nf - $ git summary -\.\.\. +\|\.\|\.\|\. 133 TJ Holowaychuk 9\.9% 115 Tj Holowaychuk 8\.5% $ git summary \-\-dedup\-by\-email -\.\.\. +\|\.\|\.\|\. 248 TJ Holowaychuk 18\.4% -. .fi -. .IP "" 0 -. .P \-\-no\-merges -. .P Exclude merge commits\. -. .P \-\-line -. .P Summarize with lines other than commits\. When \fB\-\-line\fR is specified, the last argument is treated as \. -. .P This option can not be used together with \fB\-\-dedup\-by\-email\fR or \fB\-\-no\-merges\fR\. -. .P \-\-output\-style