diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gen_api_vimdoc.py | 22 | ||||
-rwxr-xr-x | scripts/pvscheck.sh | 43 | ||||
-rwxr-xr-x | scripts/release.sh | 2 | ||||
-rwxr-xr-x | scripts/vim-patch.sh | 41 |
4 files changed, 74 insertions, 34 deletions
diff --git a/scripts/gen_api_vimdoc.py b/scripts/gen_api_vimdoc.py index 4dcb42d685..51e585a007 100644 --- a/scripts/gen_api_vimdoc.py +++ b/scripts/gen_api_vimdoc.py @@ -38,6 +38,10 @@ import subprocess from xml.dom import minidom +if sys.version_info[0] < 3: + print("use Python 3") + sys.exit(1) + doc_filename = 'api.txt' # String used to find the start of the generated part of the doc. section_start_token = '*api-global*' @@ -69,7 +73,7 @@ text_width = 78 script_path = os.path.abspath(__file__) base_dir = os.path.dirname(os.path.dirname(script_path)) src_dir = os.path.join(base_dir, 'src/nvim/api') -out_dir = os.path.join(base_dir, 'tmp/api_doc') +out_dir = os.path.join(base_dir, 'tmp-api-doc') filter_cmd = '%s %s' % (sys.executable, script_path) seen_funcs = set() @@ -217,7 +221,12 @@ def parse_para(parent, width=62): width=width) + '\n') elif child.nodeName == 'simplesect': kind = child.getAttribute('kind') - if kind == 'return': + if kind == 'note': + lines.append('Note:') + lines.append(doc_wrap(parse_para(child), + prefix=' ', + width=width)) + elif kind == 'return': lines.append('%s:~' % kind.title()) lines.append(doc_wrap(parse_para(child), prefix=' ', @@ -280,14 +289,19 @@ def parse_source_xml(filename): parts = return_type.strip('_').split('_') return_type = '%s(%s)' % (parts[0], ', '.join(parts[1:])) + name = get_text(get_child(member, 'name')) + annotations = get_text(get_child(member, 'argsstring')) if annotations and ')' in annotations: annotations = annotations.rsplit(')', 1)[-1].strip() + # XXX: (doxygen 1.8.11) 'argsstring' only includes FUNC_ATTR_* + # attributes if the function signature is non-void. + # Force attributes here for such functions. + if name == 'nvim_get_mode' and len(annotations) == 0: + annotations += 'FUNC_API_ASYNC' annotations = filter(None, map(lambda x: annotation_map.get(x), annotations.split())) - name = get_text(get_child(member, 'name')) - vimtag = '*%s()*' % name args = [] type_length = 0 diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index e4536b3dce..30c4d296d7 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -27,12 +27,8 @@ help() { echo ' pvscheck.sh [--pvs URL] --pvs-install {target-directory}' echo ' pvscheck.sh --patch [--only-build]' echo - echo ' --pvs: Use the specified URL as a path to pvs-studio archive.' - echo ' By default latest tested version is used.' - echo - echo ' May use "--pvs detect" to try detecting latest version.' - echo ' That assumes certain viva64.com site properties and' - echo ' may be broken by the site update.' + echo ' --pvs: Fetch pvs-studio from URL.' + echo ' --pvs detect: Auto-detect latest version (by scraping viva64.com).' echo echo ' --deps: (for regular run) Use top-level Makefile and build deps.' echo ' Without this it assumes all dependencies are already' @@ -360,6 +356,17 @@ run_analysis() {( plog-converter -t tasklist -o PVS-studio.tsk PVS-studio.log )} +detect_url() { + local url="${1:-detect}" + if test "$url" = detect ; then + curl --silent -L 'https://www.viva64.com/en/pvs-studio-download-linux/' \ + | grep -o 'https\{0,1\}://[^"<>]\{1,\}/pvs-studio[^/"<>]*\.tgz' \ + || echo FAILED + else + printf '%s' "$url" + fi +} + do_check() { local tgt="$1" ; shift local branch="$1" ; shift @@ -367,6 +374,15 @@ do_check() { local deps="$1" ; shift local environment_cc="$1" ; shift + if test -z "$pvs_url" || test "$pvs_url" = FAILED ; then + pvs_url="$(detect_url detect)" + if test -z "$pvs_url" || test "$pvs_url" = FAILED ; then + echo "failed to auto-detect PVS URL" + exit 1 + fi + echo "Auto-detected PVS URL: ${pvs_url}" + fi + git clone --branch="$branch" . "$tgt" install_pvs "$tgt" "$pvs_url" @@ -397,22 +413,11 @@ do_analysis() { run_analysis "$tgt" } -detect_url() { - local url="${1:-detect}" - if test "$url" = detect ; then - curl -L 'https://www.viva64.com/en/pvs-studio-download-linux/' \ - | grep -o 'https\{0,1\}://[^"<>]\{1,\}/pvs-studio[^/"<>]*\.tgz' - else - printf '%s' "$url" - fi -} - main() { - local def_pvs_url="http://files.viva64.com/pvs-studio-6.15.21741.1-x86_64.tgz" eval "$( getopts_long \ help store_const \ - pvs 'modify detect_url pvs_url "${def_pvs_url}"' \ + pvs 'modify detect_url pvs_url' \ patch store_const \ only-build 'store_const --only-build' \ recheck store_const \ @@ -431,7 +436,7 @@ main() { return 0 fi - set -x + # set -x if test -n "$patch" ; then patch_sources "$tgt" "$only_build" diff --git a/scripts/release.sh b/scripts/release.sh index 692b46e921..f1dbf99473 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -75,6 +75,8 @@ nvim +'/NVIM_VERSION' +10new +'exe "norm! iUpdate version numbers!!!\<CR>"' \ git add CMakeLists.txt git commit -m "$__BUMP_MSG" +rm CMakeLists.txt.bk || true + echo " Next steps: - Double-check NVIM_VERSION_* in CMakeLists.txt diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 4f6bb40488..2875e7d95a 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -22,9 +22,10 @@ usage() { echo "Options:" echo " -h Show this message and exit." echo " -l Show list of Vim patches missing from Neovim." - echo " -p {vim-revision} Download and apply the Vim patch vim-revision." - echo " vim-revision can be a version number of the " - echo " format '7.4.xxx' or a Git commit hash." + echo " -p {vim-revision} Download and generate the specified Vim patch." + echo " vim-revision can be a version number '8.0.xxx'" + echo " or a valid Git ref (hash, tag, etc.)." + echo " -P {vim-revision} Download, generate and apply the Vim patch." echo " -g {vim-revision} Download the Vim patch vim-revision." echo " vim-revision can be a version number of the " echo " format '7.4.xxx' or a Git commit hash." @@ -32,7 +33,7 @@ usage() { echo " -r {pr-number} Review a vim-patch pull request to Neovim." echo echo "Set VIM_SOURCE_DIR to change where Vim's sources are stored." - echo "The default is '${VIM_SOURCE_DIR_DEFAULT}'." + echo "Default is '${VIM_SOURCE_DIR_DEFAULT}'." } # Checks if a program is in the user's PATH, and is executable. @@ -150,6 +151,10 @@ preprocess_patch() { local na_po='sjiscorr.c\|ja.sjis.po\|ko.po\|pl.cp1250.po\|pl.po\|ru.cp1251.po\|uk.cp1251.po\|zh_CN.cp936.po\|zh_CN.po\|zh_TW.po' 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\<\%('${na_po}'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" + # Remove vimrc_example.vim + local na_vimrcexample='vimrc_example\.vim' + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/\<\%('${na_vimrcexample}'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" + # Rename src/ paths to src/nvim/ LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" @@ -186,6 +191,7 @@ get_vim_patch() { stage_patch() { get_vim_patch "$1" + local try_apply="${2:-}" local git_remote git_remote="$(find_git_remote)" @@ -215,14 +221,23 @@ stage_patch() { echo "ā ${output}" || (echo "ā ${output}"; false) - printf "\nInstructions: - Proceed to port the patch. This may help: - patch -p1 < ${patch_file} + if test -n "$try_apply" ; then + if ! check_executable patch; then + printf "\nā 'patch' command not found\n" + else + printf "\nApplying patch...\n" + patch -p1 --posix < "${patch_file}" + fi + printf "\nInstructions:\n Proceed to port the patch.\n" + else + printf "\nInstructions:\n Proceed to port the patch.\n Try the 'patch' command (or use '${BASENAME} -P ...' next time):\n patch -p1 < ${patch_file}\n" + fi - Stage your changes ('git add ...') and use 'git commit --amend' to commit. + printf " + Stage your changes ('git add ...'), then use 'git commit --amend' to commit. - To port additional patches related to ${vim_version} and add them to the - current branch, call '${BASENAME} -p' again. + To port more patches (if any) related to ${vim_version}, + run '${BASENAME}' again. * Do this only for _related_ patches (otherwise it increases the size of the pull request, making it harder to review) @@ -446,7 +461,7 @@ review_pr() { clean_files } -while getopts "hlp:g:r:s" opt; do +while getopts "hlp:P:g:r:s" opt; do case ${opt} in h) usage @@ -460,6 +475,10 @@ while getopts "hlp:g:r:s" opt; do stage_patch "${OPTARG}" exit 0 ;; + P) + stage_patch "${OPTARG}" TRY_APPLY + exit 0 + ;; g) get_vim_patch "${OPTARG}" exit 0 |