Skip to content

Commit fcccf53

Browse files
committed
Merge branch 'master' into vim_faq-for-vim8.1
2 parents 48cc62e + 5cff983 commit fcccf53

File tree

309 files changed

+157750
-35193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+157750
-35193
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:1.18.5-alpine3.16
2+
3+
ENV REVIEWDOG_VERSION=v0.14.1
4+
5+
# hadolint ignore=DL3006
6+
RUN apk --no-cache add git
7+
8+
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION}
9+
10+
RUN go install github.com/koron/nvcheck@latest
11+
12+
COPY entrypoint.sh /entrypoint.sh
13+
14+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Run nvcheck with reviewdog'
2+
description: '🐶Run nvcheck with reviewdog on pull requests to improve document writing experience.'
3+
author: 'Tsuyoshi CHO <[email protected]>'
4+
inputs:
5+
github_token:
6+
description: 'GITHUB_TOKEN.'
7+
required: true
8+
default: ${{ github.token }}
9+
level:
10+
description: 'Report level for reviewdog [info,warning,error]'
11+
default: 'error'
12+
reporter:
13+
description: |
14+
Reporter of reviewdog command [github-check,github-pr-review].
15+
Default is github-pr-review.
16+
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
17+
default: 'github-pr-review'
18+
filter_mode:
19+
description: |
20+
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
21+
Default is added.
22+
default: 'added'
23+
fail_on_error:
24+
description: |
25+
Exit code for reviewdog when errors are found [true,false]
26+
Default is `false`.
27+
default: 'false'
28+
reviewdog_flags:
29+
description: 'Additional reviewdog flags'
30+
default: ''
31+
tool_name:
32+
description: 'Tool name to use for reviewdog reporter'
33+
default: 'nvcheck'
34+
runs:
35+
using: 'docker'
36+
image: 'Dockerfile'
37+
branding:
38+
icon: 'chevron-down'
39+
color: 'green'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
if [ -n "${GITHUB_WORKSPACE}" ] ; then
4+
cd "${GITHUB_WORKSPACE}" || exit 1
5+
git config --global --add safe.directory "${GITHUB_WORKSPACE}" || exit 1
6+
fi
7+
8+
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
9+
10+
reviewdog_exit_val="0"
11+
# shellcheck disable=SC2086
12+
find doc -name \*.jax -print0 | xargs -0 nvcheck \
13+
| reviewdog -efm="%f:%l: %m" \
14+
-name="${INPUT_TOOL_NAME}" \
15+
-reporter="${INPUT_REPORTER:-github-pr-review}" \
16+
-filter-mode="${INPUT_FILTER_MODE}" \
17+
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
18+
-level="${INPUT_LEVEL}" \
19+
${INPUT_REVIEWDOG_FLAGS} || reviewdog_exit_val="$?"
20+
21+
# github-pr-review only diff adding
22+
if [ "${INPUT_REPORTER}" = "github-pr-review" ]; then
23+
# fix
24+
find doc -name \*.jax -print0 | xargs -0 nvcheck -i
25+
26+
TMPFILE=$(mktemp)
27+
git diff >"${TMPFILE}"
28+
29+
# shellcheck disable=SC2086
30+
reviewdog \
31+
-name="nvcheck-fix" \
32+
-f=diff \
33+
-f.diff.strip=1 \
34+
-name="${INPUT_TOOL_NAME}-fix" \
35+
-reporter="github-pr-review" \
36+
-filter-mode="diff_context" \
37+
-level="${INPUT_LEVEL}" \
38+
${INPUT_REVIEWDOG_FLAGS} < "${TMPFILE}"
39+
40+
git restore . || true
41+
rm -f "${TMPFILE}"
42+
fi
43+
44+
# Throw error if an error occurred and fail_on_error is true
45+
if [ "${INPUT_FAIL_ON_ERROR}" = "true" ] && [ "${reviewdog_exit_val}" != "0" ]; then
46+
exit 1
47+
fi
48+
49+
# EOF

.github/workflows/depup.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: depup
2+
on:
3+
schedule:
4+
- cron: '35 9 2,13,25 * *' # Runs at 9:35 UTC 2,13,25 per month
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
reviewdog:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
submodules: true
17+
18+
- name: Check depup
19+
uses: haya14busa/action-depup@v1
20+
id: depup
21+
with:
22+
file: .github/actions/vimhelp-nvcheck/Dockerfile
23+
version_name: REVIEWDOG_VERSION
24+
repo: reviewdog/reviewdog
25+
26+
- name: Create Pull Request
27+
uses: peter-evans/create-pull-request@v3
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
author: 'github-actions <41898282+github-actions[bot]@users.noreply.github.com>'
31+
title: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}"
32+
commit-message: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}"
33+
body: |
34+
Update ${{ steps.depup.outputs.repo }} to [${{ steps.depup.outputs.latest }}](https://github.com/${{ steps.depup.outputs.repo }}/releases/tag/v${{ steps.depup.outputs.latest }})
35+
36+
This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3A${{ github.workflow }}).
37+
branch: depup/${{ steps.depup.outputs.repo }}

.github/workflows/generate.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Generate vim help
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
concurrency: vimdoc-ja-deploy
8+
# global concurrency limit access to vim-jp/vimdoc-ja per workflow
9+
10+
jobs:
11+
generate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: checkout master
15+
uses: actions/checkout@v2
16+
with:
17+
path: work
18+
- name: Checkout vimdoc-ja
19+
uses: actions/checkout@v2
20+
with:
21+
path: target
22+
repository: 'vim-jp/vimdoc-ja'
23+
ssh-key: ${{ secrets.VIMDOC_JA_SSH_KEY }}
24+
- name: Setup Vim
25+
uses: thinca/action-setup-vim@v1
26+
with:
27+
vim_version: 'v8.2.0020'
28+
vim_type: 'Vim'
29+
- name: Generate new document
30+
run: |
31+
cd work
32+
# Create tags
33+
vim -eu tools/maketags.vim
34+
35+
cd ..
36+
- name: Update target
37+
run: |
38+
cd target
39+
# update latest
40+
git pull --rebase
41+
cd ..
42+
- name: Install new document
43+
run: |
44+
# install
45+
rsync -rlptD --delete-after work/doc/ target/doc
46+
rsync -rlptD --delete-after work/syntax/ target/syntax
47+
rsync -rlptD --delete-after work/README-dist.md target/README.md
48+
- name: Commit updated master branch
49+
uses: EndBug/add-and-commit@v7
50+
with:
51+
cwd: './target'
52+
default_author: github_actions
53+
message: |-
54+
Generated by GitHub workflow ${{ github.run_id }}
55+
56+
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
57+
branch: master
58+
pull: 'NO-PULL'
59+
60+
deploy:
61+
runs-on: ubuntu-latest
62+
needs: generate
63+
# "deploy" update vimdoc-ja/gh-pages branch
64+
# work after "generate" to updated vimdoc-ja/master branch
65+
# parallel work conflict vimdoc-ja repo status
66+
steps:
67+
- name: checkout master
68+
uses: actions/checkout@v2
69+
with:
70+
path: work
71+
- name: Checkout vimdoc-ja
72+
uses: actions/checkout@v2
73+
with:
74+
path: target
75+
repository: 'vim-jp/vimdoc-ja'
76+
ssh-key: ${{ secrets.VIMDOC_JA_SSH_KEY }}
77+
ref: gh-pages
78+
- name: Setup Vim
79+
uses: thinca/action-setup-vim@v1
80+
with:
81+
vim_version: 'v8.2.0020'
82+
vim_type: 'Vim'
83+
- name: Generate new document
84+
run: |
85+
cd work
86+
# Create html documents
87+
make html
88+
89+
cd ..
90+
- name: Update target
91+
run: |
92+
cd target
93+
# update latest
94+
git pull --rebase
95+
cd ..
96+
- name: Install new document
97+
run: |
98+
# install
99+
cp work/target/html/doc/*.html target
100+
- name: Commit updated master branch
101+
uses: EndBug/add-and-commit@v7
102+
with:
103+
cwd: './target'
104+
default_author: github_actions
105+
message: |-
106+
Generated by GitHub workflow ${{ github.run_id }}
107+
108+
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
109+
branch: gh-pages
110+
pull: 'NO-PULL'

.github/workflows/report.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update report
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- 'en/**'
8+
schedule:
9+
- cron: '30 15 * * SAT'
10+
workflow_dispatch:
11+
permissions:
12+
issues: write
13+
14+
jobs:
15+
report:
16+
name: Update help diff report
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Get current time
20+
uses: 1466587594/get-current-time@v2
21+
id: current-time
22+
- name: Checkout vimdoc-ja-working
23+
uses: actions/checkout@v2
24+
with:
25+
path: work
26+
- name: Checkout vim
27+
uses: actions/checkout@v2
28+
with:
29+
repository: vim/vim
30+
path: vim
31+
- name: Build report
32+
run: |
33+
bash work/tools/script/get_doc_info.sh
34+
echo Update ${{ steps.current-time.outputs.ISOTime }} >> doc_info.md
35+
- name: Create or Update issue
36+
uses: peter-evans/create-issue-from-file@v3
37+
with:
38+
title: 'Vim help : number of untranslated lines diff status'
39+
content-filepath: ./doc_info.md
40+
issue-number: 968
41+
# issue-number: if removed, create new issue/if define issue num, update numbered issue.

.github/workflows/reviewdog.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: reviewdog
2+
on: pull_request
3+
permissions:
4+
pull-requests: write
5+
6+
jobs:
7+
nvcheck:
8+
name: runner / nvcheck
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
submodules: true
15+
- name: nvcheck-github-pr-review
16+
uses: ./.github/actions/vimhelp-nvcheck/
17+
with:
18+
github_token: ${{ secrets.github_token }}
19+
reporter: github-pr-review
20+
level: error
21+
fail_on_error: true
22+
23+
# on: [push, pull_request]
24+
# - name: nvcheck-github-check
25+
# uses: ./.github/actions/vimhelp-nvcheck/
26+
# with:
27+
# github_token: ${{ secrets.github_token }}
28+
# reporter: github-check
29+
#
30+
# if need mix setting, limit push/pull_request
31+
# if: github.event_name != 'pull_request'
32+
# if: github.event_name == 'pull_request'
33+
#
34+
# on: pull_request
35+
# - name: nvcheck-github-pr-check
36+
# uses: ./.github/actions/vimhelp-nvcheck/
37+
# with:
38+
# github_token: ${{ secrets.github_token }}
39+
# reporter: github-pr-check
40+
#
41+
# - name: nvcheck-github-pr-review
42+
# uses: ./.github/actions/vimhelp-nvcheck/
43+
# with:
44+
# github_token: ${{ secrets.github_token }}
45+
# reporter: github-pr-review

.github/workflows/vimhelptagcheck.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "vim help tag name check"
2+
on: [push, pull_request]
3+
4+
jobs:
5+
tagname:
6+
name: Check tag name conflict
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: checkout
10+
uses: actions/checkout@v2
11+
- name: help tag check
12+
uses: tsuyoshicho/action-vimhelp-tagname-check@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ target
55
tmp
66
*.sw?
77
*~
8+
doc_info.md

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)