From eb2759aa1f2bd41b371a547f487666fa14558007 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 17 Jun 2018 21:47:28 +0200 Subject: [PATCH 1/3] vscode: add a dictionary for cSpell The quite useful cSpell extension allows VS Code to have "squiggly" lines under spelling mistakes. By default, this would add too much clutter, though, because so much of Git's source code uses words that would trigger cSpell. Let's add a few words to make the spell checking more useful by reducing the number of false positives. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 164 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 163 insertions(+), 1 deletion(-) diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh index 29f2a729d1c0ee..31de15742eee12 100755 --- a/contrib/vscode/init.sh +++ b/contrib/vscode/init.sh @@ -32,7 +32,169 @@ cat >.vscode/settings.json.new <<\EOF || "files.associations": { "*.h": "c", "*.c": "c" - } + }, + "cSpell.words": [ + "DATAW", + "DBCACHED", + "DFCHECK", + "DTYPE", + "HCAST", + "HEXSZ", + "HKEY", + "HKLM", + "IFGITLINK", + "IFINVALID", + "ISBROKEN", + "ISGITLINK", + "ISSYMREF", + "LPDWORD", + "LPPROC", + "LPWSTR", + "MSVCRT", + "NOARG", + "NOCOMPLETE", + "NOINHERIT", + "RENORMALIZE", + "STARTF", + "STARTUPINFOEXW", + "Schindelin", + "UCRT", + "YESNO", + "argcp", + "beginthreadex", + "committish", + "contentp", + "cpath", + "cpidx", + "ctim", + "dequote", + "envw", + "ewah", + "fdata", + "fherr", + "fhin", + "fhout", + "fragp", + "fsmonitor", + "hnsec", + "idents", + "includeif", + "interpr", + "iprog", + "isexe", + "iskeychar", + "kompare", + "mksnpath", + "mktag", + "mktree", + "mmblob", + "mmbuffer", + "mmfile", + "noenv", + "nparents", + "ntpath", + "ondisk", + "ooid", + "oplen", + "osdl", + "pnew", + "pold", + "ppinfo", + "pushf", + "pushv", + "rawsz", + "reencode", + "repo", + "rerere", + "scld", + "sharedrepo", + "spawnv", + "spawnve", + "spawnvpe", + "strdup'ing", + "topath", + "topo", + "tpatch", + "unexecutable", + "unhide", + "unkc", + "unkv", + "unmark", + "unmatch", + "unsets", + "unshown", + "untracked", + "untrackedcache", + "unuse", + "upos", + "uval", + "vreportf", + "wargs", + "wargv", + "wbuffer", + "wcmd", + "wcsnicmp", + "wcstoutfdup", + "wdeltaenv", + "wdir", + "wenv", + "wenvblk", + "wenvcmp", + "wenviron", + "wenvpos", + "wenvsz", + "wfile", + "wfilename", + "wfopen", + "wfreopen", + "wfullpath", + "which'll", + "wlink", + "wmain", + "wmkdir", + "wmktemp", + "wnewpath", + "wotype", + "wpath", + "wpathname", + "wpgmptr", + "wpnew", + "wpointer", + "wpold", + "wpos", + "wputenv", + "wrmdir", + "wship", + "wtarget", + "wtemplate", + "wunlink", + "xcalloc", + "xgetcwd", + "xmallocz", + "xmemdupz", + "xmmap", + "xopts", + "xrealloc", + "xsnprintf", + "xutftowcs", + "xutftowcsn", + "xwcstoutf" + ], + "cSpell.ignoreRegExpList": [ + "\\\"(DIRC|FSMN|REUC|UNTR)\\\"", + "\\\\u[0-9a-fA-Fx]{4}\\b", + "\\b(filfre|frotz|xyzzy)\\b", + "\\bCMIT_FMT_DEFAULT\\b", + "\\bde-munge\\b", + "\\bGET_OID_DISAMBIGUATORS\\b", + "\\bHASH_RENORMALIZE\\b", + "\\bTREESAMEness\\b", + "\\bUSE_STDEV\\b", + "\\Wchar *\\*\\W*utfs\\W", + "cURL's", + "nedmalloc'ed", + "ntifs\\.h", + ], } EOF die "Could not write settings.json" From 60ce1e4b220c4ffa43ca8ead98317f5d47091052 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 17 Jun 2018 21:52:37 +0200 Subject: [PATCH 2/3] vscode: let cSpell work on commit messages, too By default, the cSpell extension ignores all files under .git/. That includes, unfortunately, COMMIT_EDITMSG, i.e. commit messages. However, spell checking is *quite* useful when writing commit messages... And since the user hardly ever opens any file inside .git (apart from commit messages, the config, and sometimes interactive rebase's todo lists), there is really not much harm in *not* ignoring .git/. The default also ignores `node_modules/`, but that does not apply to Git, so let's skip ignoring that, too. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh index 31de15742eee12..a77d85a874cf93 100755 --- a/contrib/vscode/init.sh +++ b/contrib/vscode/init.sh @@ -33,6 +33,8 @@ cat >.vscode/settings.json.new <<\EOF || "*.h": "c", "*.c": "c" }, + "cSpell.ignorePaths": [ + ], "cSpell.words": [ "DATAW", "DBCACHED", From 6b5d2a8605558fad2b248f7f28f91c32719bc136 Mon Sep 17 00:00:00 2001 From: Olga Telezhnaia Date: Mon, 25 Jun 2018 11:43:20 +0300 Subject: [PATCH 3/3] init.sh: add instruction to install packages for Ubuntu Signed-off-by: Olga Telezhnaia --- contrib/vscode/init.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh index a77d85a874cf93..0fd9f13d26c14a 100755 --- a/contrib/vscode/init.sh +++ b/contrib/vscode/init.sh @@ -5,6 +5,17 @@ die () { exit 1 } +if grep '^NAME="Ubuntu"' /etc/os-release >/dev/null 2>&1 && + (test ! -f /usr/include/openssl/ssl.h || + test ! -f /usr/include/expat.h || + test ! -f /usr/include/zlib.h) ; +then + die "Some files missing. Try to run these commands in advance: + sudo apt-get update + sudo apt-get install git gcc make libssl-dev libcurl4-openssl-dev \\ + libexpat-dev tcl tk gettext git-email zlib1g-dev" +fi + cd "$(dirname "$0")"/../.. || die "Could not cd to top-level directory"