From 319563725243485d11bc980efd3821ae9cef4ddd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 15 Sep 2019 16:34:31 -0700 Subject: release.sh [ci skip] --- scripts/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/release.sh b/scripts/release.sh index 29d61370ce..7ac80b7e01 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -80,7 +80,7 @@ _do_bump_commit() { ,' runtime/nvim.appdata.xml rm CMakeLists.txt.bk rm runtime/nvim.appdata.xml.bk - nvim +'/NVIM_VERSION' +1new +'exe "norm! iUpdate version numbers!!!\"' \ + nvim +'/NVIM_VERSION' +1new +'exe "norm! iUpdate version numbers!!!"' \ -O CMakeLists.txt runtime/nvim.appdata.xml git add CMakeLists.txt runtime/nvim.appdata.xml -- cgit From 8f3d0276ee8ff0d35e07d3767e7dc5ace9d2b2d0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 15 Sep 2019 23:08:40 -0700 Subject: release.sh [ci skip] --- scripts/release.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/release.sh b/scripts/release.sh index 7ac80b7e01..67268ba9bf 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -93,8 +93,7 @@ fi _do_bump_commit echo " Next steps: - - Double-check NVIM_VERSION_* in CMakeLists.txt - - Double-check runtime/nvim.appdata.xml + - Run tests/CI (version_spec.lua)! - Push the tag: git push --follow-tags - Update the 'stable' tag: -- cgit From b18b84df5eab9829ecbef644ef0af226becf881d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 30 Sep 2019 00:10:29 +0200 Subject: build: run git-describe for dev version during build (#11117) This avoids invoking CMake after a new commit, which might take 15s on some systems. Skipped on CMake < 3.2.0 (missing BYPRODUCTS support). Co-Authored-By: Justin M. Keyes --- scripts/update_version_stamp.lua | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/update_version_stamp.lua (limited to 'scripts') diff --git a/scripts/update_version_stamp.lua b/scripts/update_version_stamp.lua new file mode 100644 index 0000000000..f01642043a --- /dev/null +++ b/scripts/update_version_stamp.lua @@ -0,0 +1,45 @@ +#!/usr/bin/env lua +-- +-- Script to update the Git version stamp during build. +-- This is called via the custom update_version_stamp target in +-- src/nvim/CMakeLists.txt. +-- +-- arg[1]: file containing the last git-describe output +-- arg[2]: file in which to update the version string + +local function die(msg) + print(string.format('%s: %s', arg[0], msg)) + -- No error, fall back to using generated "-dev" version. + os.exit(0) +end + +if #arg ~= 2 then + die(string.format("Expected two args, got %d", #arg)) +end + +local stampfile = arg[1] +local stamp = io.open(stampfile, 'r') +if stamp then + stamp = stamp:read('*l') +end + +local current = io.popen('git describe --dirty'):read('*l') +if not current then + die('git-describe failed') +end + +if stamp ~= current then + if stamp then + print(string.format('git version changed: %s -> %s', stamp, current)) + end + local new_lines = {} + local versiondeffile = arg[2] + for line in io.lines(versiondeffile) do + if line:match("NVIM_VERSION_MEDIUM") then + line = '#define NVIM_VERSION_MEDIUM "'..current..'"' + end + new_lines[#new_lines + 1] = line + end + io.open(versiondeffile, 'w'):write(table.concat(new_lines, '\n') .. '\n') + io.open(stampfile, 'w'):write(current) +end -- cgit From 30ae60e7cac7e77005aa429bc13f8ffa3ce64eb1 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 2 Oct 2019 03:45:59 +0200 Subject: Fix/revisit git-describe enhancement (#11124) * Fix/keep massaging git-describe result Ref: https://github.com/neovim/neovim/pull/11117#issuecomment-536416223 * build: revisit generation of version from Git Fixes "make clean && make", where "auto/versiondef.h" would be missing since b18b84d - because BYPRODUCTS are apparently removed when cleaning. This includes the following improvements/changes: - do not run git-describe during CMake's configure phase just for reporting - do not print with changed Git version (too noisy, simplifies code) * Move to src/nvim (included before config) for easier flow * fallback to describe always, write empty include file * update_version_stamp.lua: use prefix always --- scripts/update_version_stamp.lua | 53 ++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 24 deletions(-) mode change 100644 => 100755 scripts/update_version_stamp.lua (limited to 'scripts') diff --git a/scripts/update_version_stamp.lua b/scripts/update_version_stamp.lua old mode 100644 new mode 100755 index f01642043a..509e1f6fad --- a/scripts/update_version_stamp.lua +++ b/scripts/update_version_stamp.lua @@ -4,11 +4,11 @@ -- This is called via the custom update_version_stamp target in -- src/nvim/CMakeLists.txt. -- --- arg[1]: file containing the last git-describe output --- arg[2]: file in which to update the version string +-- arg[1]: file in which to update the version string +-- arg[2]: prefix to use always ("vX.Y.Z") local function die(msg) - print(string.format('%s: %s', arg[0], msg)) + io.stderr:write(string.format('%s: %s\n', arg[0], msg)) -- No error, fall back to using generated "-dev" version. os.exit(0) end @@ -17,29 +17,34 @@ if #arg ~= 2 then die(string.format("Expected two args, got %d", #arg)) end -local stampfile = arg[1] -local stamp = io.open(stampfile, 'r') -if stamp then - stamp = stamp:read('*l') +local versiondeffile = arg[1] +local prefix = arg[2] + +local described = io.popen('git describe --dirty'):read('*l') +if not described then + described = io.popen('git describe --tags --always --dirty'):read('*l') +end +if not described then + io.open(versiondeffile, 'w'):write('\n') + die('git-describe failed, using empty include file.') +end + +-- `git describe` annotates the most recent tagged release; for pre-release +-- builds we must replace that with the unreleased version. +local with_prefix = described:gsub("^v%d+%.%d+%.%d+", prefix) +if described == with_prefix then + -- Prepend the prefix always, e.g. with "nightly-12208-g4041b62b9". + with_prefix = prefix .. "-" .. described end -local current = io.popen('git describe --dirty'):read('*l') -if not current then - die('git-describe failed') +-- Read existing include file. +local current = io.open(versiondeffile, 'r') +if current then + current = current:read('*l') end -if stamp ~= current then - if stamp then - print(string.format('git version changed: %s -> %s', stamp, current)) - end - local new_lines = {} - local versiondeffile = arg[2] - for line in io.lines(versiondeffile) do - if line:match("NVIM_VERSION_MEDIUM") then - line = '#define NVIM_VERSION_MEDIUM "'..current..'"' - end - new_lines[#new_lines + 1] = line - end - io.open(versiondeffile, 'w'):write(table.concat(new_lines, '\n') .. '\n') - io.open(stampfile, 'w'):write(current) +-- Write new include file, if different. +local new = '#define NVIM_VERSION_MEDIUM "'..with_prefix..'"' +if current ~= new then + io.open(versiondeffile, 'w'):write(new .. '\n') end -- cgit From 6768c43e2129af85923ed0b4ed9f6f47be42b4fb Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 10 Oct 2019 10:38:15 +0200 Subject: update_version_stamp: redirect stderr on first try, --first-parent #11186 Avoid noise during builds: > fatal: No annotated tags can describe '417449f468c4ba186954f6295b3338fb55ee7b4a'. > However, there were unannotated tags: try --tags. This might be useful in general, but is expected to not happen - and falling back is OK then. The fallback command would still display errors then. It also uses `--first-parent`, which is important for when a release branch gets merged back. --- scripts/update_version_stamp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/update_version_stamp.lua b/scripts/update_version_stamp.lua index 509e1f6fad..394c4f7694 100755 --- a/scripts/update_version_stamp.lua +++ b/scripts/update_version_stamp.lua @@ -20,9 +20,9 @@ end local versiondeffile = arg[1] local prefix = arg[2] -local described = io.popen('git describe --dirty'):read('*l') +local described = io.popen('git describe --first-parent --dirty 2>/dev/null'):read('*l') if not described then - described = io.popen('git describe --tags --always --dirty'):read('*l') + described = io.popen('git describe --first-parent --tags --always --dirty'):read('*l') end if not described then io.open(versiondeffile, 'w'):write('\n') -- cgit From 5cf6beb22178a844bc1b6e75e744eb04508b865c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 13 Oct 2019 23:09:09 +0200 Subject: scripts/vim-patch.sh -l: display commit subjects Closes https://github.com/neovim/neovim/pull/11182. --- scripts/vim-patch.sh | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 2cc32f0dd0..4efe509008 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -366,7 +366,7 @@ submit_pr() { # Gets all Vim commits since the "start" commit. list_vim_commits() { ( - cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v8.0.0000..HEAD "$@" + cd "${VIM_SOURCE_DIR}" && git log --reverse v8.0.0000..HEAD "$@" ) } # Prints all (sorted) "vim-patch:xxx" tokens found in the Nvim git log. @@ -389,6 +389,7 @@ list_vimpatch_numbers() { } # Prints a newline-delimited list of Vim commits, for use by scripts. +# "$1": use extended format? # "$@" is passed to list_vim_commits, as extra arguments to git-log. list_missing_vimpatches() { local token vim_commit vim_tag patch_number @@ -396,6 +397,13 @@ list_missing_vimpatches() { declare -A vim_commit_tags declare -a git_log_args + local extended_format=$1; shift + if [[ "$extended_format" == 1 ]]; then + git_log_args=("--format=%H %s") + else + git_log_args=("--format=%H") + fi + # Massage arguments for git-log. declare -A git_log_replacements=( [^\(.*/\)?src/nvim/\(.*\)]="\${BASH_REMATCH[1]}src/\${BASH_REMATCH[2]}" @@ -431,13 +439,27 @@ list_missing_vimpatches() { # Get missing Vim commits set +u # Avoid "unbound variable" with bash < 4.4 below. - for vim_commit in $(list_vim_commits "${git_log_args[@]}"); do + local vim_commit info + while IFS=' ' read -r line; do # Check for vim-patch: (usually runtime updates). - token="vim-patch:${vim_commit:0:7}" + token="vim-patch:${line:0:7}" if [[ "${tokens[$token]-}" ]]; then continue fi + # Get commit hash, and optional info from line. This is used in + # extended mode, and when using e.g. '--format' manually. + vim_commit=${line%% *} + if [[ "$vim_commit" == "$line" ]]; then + info= + else + info=${line#* } + if [[ -n $info ]]; then + # Remove any "patch 8.0.0902: " prefixes, and prefix with ": ". + info=": ${info#patch*: }" + fi + fi + vim_tag="${vim_commit_tags[$vim_commit]-}" if [[ -n "$vim_tag" ]]; then # Check for vim-patch: (not commit hash). @@ -445,11 +467,11 @@ list_missing_vimpatches() { if [[ "${tokens[$patch_number]-}" ]]; then continue fi - echo "$vim_tag" + printf '%s%s\n' "$vim_tag" "$info" else - echo "$vim_commit" + printf '%s%s\n' "$vim_commit" "$info" fi - done + done < <(list_vim_commits "${git_log_args[@]}") set -u } @@ -464,7 +486,7 @@ show_vimpatches() { runtime_commits[$commit]=1 done - list_missing_vimpatches "$@" | while read -r vim_commit; do + list_missing_vimpatches 1 "$@" | while read -r vim_commit; do if [[ "${runtime_commits[$vim_commit]-}" ]]; then printf ' • %s (+runtime)\n' "${vim_commit}" else @@ -596,7 +618,7 @@ while getopts "hlLMVp:P:g:r:s" opt; do ;; L) shift # remove opt - list_missing_vimpatches "$@" + list_missing_vimpatches 0 "$@" exit 0 ;; M) -- cgit From c5c06665ed302e774dc1a01bed949815b4b7c8c3 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 16 Oct 2019 15:44:38 +0200 Subject: scripts/vim-patch.sh: lazily update Vim source (#11207) This gets done only initially, for `-l`, and when a commit cannot be found. Also provide more compact instructions with `-l` / `show_vimpatches`. --- scripts/vim-patch.sh | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 4efe509008..2a04805606 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -89,7 +89,7 @@ get_vim_sources() { echo "Cloning Vim into: ${VIM_SOURCE_DIR}" git clone https://github.com/vim/vim.git "${VIM_SOURCE_DIR}" cd "${VIM_SOURCE_DIR}" - else + elif [[ "${1-}" == update ]]; then cd "${VIM_SOURCE_DIR}" if ! [ -d ".git" ] \ && ! [ "$(git rev-parse --show-toplevel)" = "${VIM_SOURCE_DIR}" ]; then @@ -103,6 +103,8 @@ get_vim_sources() { else msg_err "Could not update Vim sources; ignoring error." fi + else + cd "${VIM_SOURCE_DIR}" fi } @@ -124,7 +126,7 @@ find_git_remote() { } # Assign variables for a given Vim tag, patch version, or commit. -# Might exit in case it cannot be found. +# Might exit in case it cannot be found, after updating Vim sources. assign_commit_details() { local vim_commit_ref if [[ ${1} =~ v?[0-9]\.[0-9]\.[0-9]{3,4} ]]; then @@ -146,9 +148,14 @@ assign_commit_details() { local munge_commit_line=false fi - vim_commit=$(git -C "${VIM_SOURCE_DIR}" log -1 --format="%H" "${vim_commit_ref}" --) || { - >&2 msg_err "Couldn't find Vim revision '${vim_commit_ref}'." - exit 3 + local get_vim_commit_cmd="git -C ${VIM_SOURCE_DIR} log -1 --format=%H ${vim_commit_ref} --" + vim_commit=$($get_vim_commit_cmd 2>&1) || { + # Update Vim sources. + get_vim_sources update + vim_commit=$($get_vim_commit_cmd 2>&1) || { + >&2 msg_err "Couldn't find Vim revision '${vim_commit_ref}': git error: ${vim_commit}." + exit 3 + } } vim_commit_url="https://github.com/vim/vim/commit/${vim_commit}" @@ -478,8 +485,8 @@ list_missing_vimpatches() { # Prints a human-formatted list of Vim commits, with instructional messages. # Passes "$@" onto list_missing_vimpatches (args for git-log). show_vimpatches() { - get_vim_sources - printf "\nVim patches missing from Neovim:\n" + get_vim_sources update + printf "Vim patches missing from Neovim:\n" local -A runtime_commits for commit in $(git -C "${VIM_SOURCE_DIR}" log --format="%H %D" -- runtime | sed 's/,\? tag: / /g'); do @@ -494,17 +501,12 @@ show_vimpatches() { fi done - printf "Instructions: - - To port one of the above patches to Neovim, execute - this script with the patch revision as argument and - follow the instructions. - - Examples: '%s -p 7.4.487' - '%s -p 1e8ebf870720e7b671f98f22d653009826304c4f' + printf "\nInstructions: + To port one of the above patches to Neovim, execute this script with the patch revision as argument and follow the instructions, e.g. + '%s -p v8.0.1234', or '%s -P v8.0.1234' NOTE: Please port the _oldest_ patch if you possibly can. - Out-of-order patches increase the possibility of bugs. + You can use '%s -l path/to/file' to see what patches are missing for a file. " "${BASENAME}" "${BASENAME}" } @@ -646,7 +648,7 @@ while getopts "hlLMVp:P:g:r:s" opt; do exit 0 ;; V) - get_vim_sources + get_vim_sources update exit 0 ;; *) -- cgit From 46bde66147ead1bb234932a48e2c56fc4b698ec0 Mon Sep 17 00:00:00 2001 From: smolck <46855713+smolck@users.noreply.github.com> Date: Sat, 26 Oct 2019 14:54:54 -0500 Subject: gen_vimdoc.py: dump API docs to msgpack #11296 Convenient for API clients who want to reuse the API docs in their own docs. Could be used e.g. to eliminate nvim.net's own doxygen parser: https://github.com/neovim/nvim.net/tree/3a736232a4e7b7a2a1eff4bded24d2bf27a918c2/src/NvimClient.APIGenerator/Docs TODO: currently the result values are formatted as Vim help docs. We should change the values to have structure, something like this: [{ 'nvim_win_get_var': [ 'line1, 'line2', [ 'item1', 'item2', ... ] ], 'nvim_win_set_var': [ ... ], ... }] close #11296 --- scripts/gen_vimdoc.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 373a58d11e..aa50132d4c 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -36,11 +36,12 @@ import shutil import textwrap import subprocess import collections +import msgpack from xml.dom import minidom -if sys.version_info[0] < 3: - print("use Python 3") +if sys.version_info[0] < 3 or sys.version_info[1] < 5: + print("requires Python 3.5+") sys.exit(1) DEBUG = ('DEBUG' in os.environ) @@ -453,7 +454,7 @@ def parse_source_xml(filename, mode): """ global xrefs xrefs = set() - functions = [] + functions = {} # Map of func_name:docstring. deprecated_functions = [] dom = minidom.parse(filename) @@ -577,11 +578,11 @@ def parse_source_xml(filename, mode): if 'Deprecated' in xrefs: deprecated_functions.append(func_doc) elif name.startswith(CONFIG[mode]['func_name_prefix']): - functions.append(func_doc) + functions[name] = func_doc xrefs.clear() - return '\n\n'.join(functions), '\n\n'.join(deprecated_functions) + return '\n\n'.join(list(functions.values())), '\n\n'.join(deprecated_functions), functions def delete_lines_below(filename, tokenstr): @@ -604,6 +605,12 @@ def gen_docs(config): Doxygen is called and configured through stdin. """ for mode in CONFIG: + functions = {} # Map of func_name:docstring. + mpack_file = os.path.join(base_dir, 'runtime', 'doc', + CONFIG[mode]['filename'].replace('.txt', '.mpack')) + if os.path.exists(mpack_file): + os.remove(mpack_file) + output_dir = out_dir.format(mode=mode) p = subprocess.Popen(['doxygen', '-'], stdin=subprocess.PIPE) p.communicate( @@ -645,14 +652,15 @@ def gen_docs(config): filename = get_text(find_first(compound, 'name')) if filename.endswith('.c') or filename.endswith('.lua'): - functions, deprecated = parse_source_xml( + functions_text, deprecated_text, fns = parse_source_xml( os.path.join(base, '%s.xml' % compound.getAttribute('refid')), mode) + # Collect functions from all modules (for the current `mode`). + functions = {**functions, **fns} - if not functions and not deprecated: + if not functions_text and not deprecated_text: continue - - if functions or deprecated: + else: name = os.path.splitext(os.path.basename(filename))[0] if name == 'ui': name = name.upper() @@ -665,12 +673,12 @@ def gen_docs(config): if intro: doc += '\n\n' + intro - if functions: - doc += '\n\n' + functions + if functions_text: + doc += '\n\n' + functions_text - if INCLUDE_DEPRECATED and deprecated: + if INCLUDE_DEPRECATED and deprecated_text: doc += '\n\n\nDeprecated %s Functions: ~\n\n' % name - doc += deprecated + doc += deprecated_text if doc: filename = os.path.basename(filename) @@ -713,6 +721,8 @@ def gen_docs(config): delete_lines_below(doc_file, CONFIG[mode]['section_start_token']) with open(doc_file, 'ab') as fp: fp.write(docs.encode('utf8')) + with open(mpack_file, 'wb') as fp: + fp.write(msgpack.packb(functions, use_bin_type=True)) shutil.rmtree(output_dir) -- cgit From 6d8fe9b3f40d0d3f4ddeed56f592dfd2be810f7f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 26 Oct 2019 16:21:22 -0700 Subject: lint --- scripts/gen_vimdoc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index aa50132d4c..8d0cf54828 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -582,7 +582,9 @@ def parse_source_xml(filename, mode): xrefs.clear() - return '\n\n'.join(list(functions.values())), '\n\n'.join(deprecated_functions), functions + return ('\n\n'.join(list(functions.values())), + '\n\n'.join(deprecated_functions), + functions) def delete_lines_below(filename, tokenstr): @@ -606,7 +608,8 @@ def gen_docs(config): """ for mode in CONFIG: functions = {} # Map of func_name:docstring. - mpack_file = os.path.join(base_dir, 'runtime', 'doc', + mpack_file = os.path.join( + base_dir, 'runtime', 'doc', CONFIG[mode]['filename'].replace('.txt', '.mpack')) if os.path.exists(mpack_file): os.remove(mpack_file) @@ -653,8 +656,8 @@ def gen_docs(config): filename = get_text(find_first(compound, 'name')) if filename.endswith('.c') or filename.endswith('.lua'): functions_text, deprecated_text, fns = parse_source_xml( - os.path.join(base, '%s.xml' % - compound.getAttribute('refid')), mode) + os.path.join(base, '{}.xml'.format( + compound.getAttribute('refid'))), mode) # Collect functions from all modules (for the current `mode`). functions = {**functions, **fns} -- cgit From f9da2673737d8585c573f04099f1efe0dd30f526 Mon Sep 17 00:00:00 2001 From: Hirokazu Hata Date: Sun, 27 Oct 2019 11:58:28 +0900 Subject: scripts/lua2dox.lua: Remove class declaration block Judging class definitions in the form "string.find (line, '=% s * class% (')" must force writing class definitions in this format, but such a mechanism is Absent. Also, Lua has no formal class in the language specification, and implements inheritance with setmetadable. To detect this, we should have a parser for it, not a simple regular expression. --- scripts/lua2dox.lua | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/lua2dox.lua b/scripts/lua2dox.lua index 77cdabcc4b..438f734917 100644 --- a/scripts/lua2dox.lua +++ b/scripts/lua2dox.lua @@ -543,7 +543,6 @@ function TLua2DoX_filter.readfile(this,AppStamp,Filename) local fn = TString_removeCommentFromLine(string_trim(string.sub(line,pos_fn+8))) if fn_magic then fn = fn_magic - fn_magic = nil end if string.sub(fn,1,1)=='(' then @@ -554,49 +553,20 @@ function TLua2DoX_filter.readfile(this,AppStamp,Filename) -- want to fix for iffy declarations local open_paren = string.find(fn,'[%({]') - local fn0 = fn if open_paren then - fn0 = string.sub(fn,1,open_paren-1) -- we might have a missing close paren if not string.find(fn,'%)') then fn = fn .. ' ___MissingCloseParenHere___)' end end - local dot = string.find(fn0,'[%.:]') - if dot then -- it's a method - local klass = string.sub(fn,1,dot-1) - local method = string.sub(fn,dot+1) - --TCore_IO_writeln('function ' .. klass .. '::' .. method .. ftail .. '{}') - --TCore_IO_writeln(klass .. '::' .. method .. ftail .. '{}') - outStream:writeln( - '/*! \\memberof ' .. klass .. ' */ ' - .. method .. '{}' - ) - else - -- add vanilla function - - outStream:writeln(fn_type .. 'function ' .. fn .. '{}') - end + -- add vanilla function + outStream:writeln(fn_type .. 'function ' .. fn .. '{}') end else this:warning(inStream:getLineNo(),'something weird here') end fn_magic = nil -- mustn't indavertently use it again - elseif string.find(line,'=%s*class%(') then - state = 'in_class' -- it's a class declaration - local tailComment - line,tailComment = TString_removeCommentFromLine(line) - local equals = string.find(line,'=') - local klass = string_trim(string.sub(line,1,equals-1)) - local tail = string_trim(string.sub(line,equals+1)) - -- class(wibble wibble) - -- ....v. - local parent = string.sub(tail,7,-2) - if #parent>0 then - parent = ' :public ' .. parent - end - outStream:writeln('class ' .. klass .. parent .. '{};') else state = '' -- unknown if #line>0 then -- we don't know what this line means, so just comment it out -- cgit From 90981f5861e4c23c6a23a0082261b074ba48ea47 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 2 Nov 2019 04:54:59 +0900 Subject: update_version_stamp.lua: Use NUL on Windows #11323 --- scripts/update_version_stamp.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/update_version_stamp.lua b/scripts/update_version_stamp.lua index 394c4f7694..11b521fab6 100755 --- a/scripts/update_version_stamp.lua +++ b/scripts/update_version_stamp.lua @@ -13,6 +13,10 @@ local function die(msg) os.exit(0) end +local function iswin() + return package.config:sub(1,1) == '\\' +end + if #arg ~= 2 then die(string.format("Expected two args, got %d", #arg)) end @@ -20,7 +24,8 @@ end local versiondeffile = arg[1] local prefix = arg[2] -local described = io.popen('git describe --first-parent --dirty 2>/dev/null'):read('*l') +local dev_null = iswin() and 'NUL' or '/dev/null' +local described = io.popen('git describe --first-parent --dirty 2>'..dev_null):read('*l') if not described then described = io.popen('git describe --first-parent --tags --always --dirty'):read('*l') end -- cgit From 2ba212e8c25794184ce465d468eb62714ea7ba03 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 8 Nov 2019 15:17:55 +0100 Subject: vim-patch.sh: add missing argument [skip ci] --- scripts/vim-patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 2a04805606..b946266599 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -507,7 +507,7 @@ show_vimpatches() { NOTE: Please port the _oldest_ patch if you possibly can. You can use '%s -l path/to/file' to see what patches are missing for a file. -" "${BASENAME}" "${BASENAME}" +" "${BASENAME}" "${BASENAME}" "${BASENAME}" } review_commit() { -- cgit From 9fb278ddea492cdae53be6fd948c75498df2f712 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 8 Nov 2019 20:47:58 +0100 Subject: vim-patch.sh: multiline printf -> heredoc (#11351) The following script is cut out from vim-patch.sh: ```sh #!/usr/bin/env bash BASENAME=vim-patch.sh printf "\nInstructions: To port one of the above patches to Neovim, execute this script with the patch revision as argument and follow the instructions, e.g. '%s -p v8.0.1234', or '%s -P v8.0.1234' NOTE: Please port the _oldest_ patch if you possibly can. You can use '%s -l path/to/file' to see what patches are missing for a file. " "${BASENAME}" "${BASENAME}" "${BASENAME}" ``` The code itself should be correct, but shellcheck 0.7.0 says: ``` In /tmp/test.sh line 5: printf "\nInstructions: ^-- SC2183: This format string has 2 variables, but is passed 3 arguments. ``` We also had a problem before that a `%s` was added, but the accompanying argument to printf was forgotten. Using a heredoc is less error-prone, since we insert variables directly. --- scripts/vim-patch.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index b946266599..b6a0df4649 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -501,13 +501,15 @@ show_vimpatches() { fi done - printf "\nInstructions: + cat << EOF + +Instructions: To port one of the above patches to Neovim, execute this script with the patch revision as argument and follow the instructions, e.g. - '%s -p v8.0.1234', or '%s -P v8.0.1234' + '${BASENAME} -p v8.0.1234', or '${BASENAME} -P v8.0.1234' NOTE: Please port the _oldest_ patch if you possibly can. - You can use '%s -l path/to/file' to see what patches are missing for a file. -" "${BASENAME}" "${BASENAME}" "${BASENAME}" + You can use '${BASENAME} -l path/to/file' to see what patches are missing for a file. +EOF } review_commit() { -- cgit From af53a0c0123338575dd59934449d7fe836835d1c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 17 Nov 2019 19:06:59 -0800 Subject: doc: Lua [ci skip] #11378 - Rework :help lua-commands - Rename if_lua.txt => lua.txt --- scripts/gen_vimdoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 8d0cf54828..4d71d5e15e 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -85,7 +85,7 @@ CONFIG = { 'append_only': [], }, 'lua': { - 'filename': 'if_lua.txt', + 'filename': 'lua.txt', 'section_start_token': '*lua-vim*', 'section_order': [ 'vim.lua', -- cgit From f460bae441b2a35964c3535396e251c33c997395 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 24 Nov 2019 17:53:33 -0800 Subject: release.sh [ci skip] --- scripts/release.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/release.sh b/scripts/release.sh index 67268ba9bf..5b4902a2d7 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -93,6 +93,7 @@ fi _do_bump_commit echo " Next steps: + - Update runtime/nvim.appdata.xml on _master_ - Run tests/CI (version_spec.lua)! - Push the tag: git push --follow-tags -- cgit From 001e69cd4602e84219fd7cfd8ade62f0cb24097c Mon Sep 17 00:00:00 2001 From: Brian Wignall Date: Tue, 26 Nov 2019 07:15:14 -0500 Subject: doc: fix typos close #11459 --- scripts/lua2dox.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/lua2dox.lua b/scripts/lua2dox.lua index 438f734917..171621e38d 100644 --- a/scripts/lua2dox.lua +++ b/scripts/lua2dox.lua @@ -65,7 +65,7 @@ FILTER_PATTERNS = *.lua=lua2dox_filter Either add them to the end or find the appropriate entry in Doxyfile. -There are other lines that you might like to alter, but see futher documentation for details. +There are other lines that you might like to alter, but see further documentation for details.
  • When Doxyfile is edited run "doxygen" -- cgit