From c92b80e8070e734bec0e766b6eaf9e5f78fad7ec Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 1 Mar 2018 11:10:20 -0800 Subject: [PATCH] Parse a bunch of files from bash-it on CI --- .gitmodules | 3 ++ .npmignore | 1 + examples/bash-it | 1 + package.json | 2 +- script/known-failures.txt | 59 +++++++++++++++++++++++++++++++++++++++ script/parse-examples.sh | 15 ++++++++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 examples/bash-it create mode 100644 script/known-failures.txt create mode 100755 script/parse-examples.sh diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cf1997e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "examples/bash-it"] + path = examples/bash-it + url = https://github.com/Bash-it/bash-it.git diff --git a/.npmignore b/.npmignore index 3c42c29..e768c9a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ corpus build examples +script diff --git a/examples/bash-it b/examples/bash-it new file mode 160000 index 0000000..c3d9c46 --- /dev/null +++ b/examples/bash-it @@ -0,0 +1 @@ +Subproject commit c3d9c46ef832f808c929a22b36c8ef6dd45cb98a diff --git a/package.json b/package.json index 38f6249..7fdb27a 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,6 @@ }, "scripts": { "build": "tree-sitter generate && node-gyp build", - "test": "tree-sitter test && tree-sitter parse examples/* --quiet --time" + "test": "tree-sitter test && script/parse-examples.sh" } } diff --git a/script/known-failures.txt b/script/known-failures.txt new file mode 100644 index 0000000..2aa27d7 --- /dev/null +++ b/script/known-failures.txt @@ -0,0 +1,59 @@ +examples/bash-it/plugins/available/git.plugin.bash +examples/bash-it/plugins/available/fasd.plugin.bash +examples/bash-it/plugins/available/fzf.plugin.bash +examples/bash-it/plugins/available/z.plugin.bash +examples/bash-it/plugins/available/extract.plugin.bash +examples/bash-it/plugins/available/less-pretty-cat.plugin.bash +examples/bash-it/plugins/available/z_autoenv.plugin.bash +examples/bash-it/plugins/available/sshagent.plugin.bash +examples/bash-it/plugins/available/gif.plugin.bash +examples/bash-it/plugins/available/go.plugin.bash +examples/bash-it/plugins/available/proxy.plugin.bash +examples/bash-it/plugins/available/browser.plugin.bash +examples/bash-it/install.sh +examples/bash-it/completion/available/terraform.completion.bash +examples/bash-it/completion/available/go.completion.bash +examples/bash-it/completion/available/maven.completion.bash +examples/bash-it/completion/available/svn.completion.bash +examples/bash-it/completion/available/docker-compose.completion.bash +examples/bash-it/completion/available/jboss7.completion.bash +examples/bash-it/completion/available/todo.completion.bash +examples/bash-it/completion/available/gh.completion.bash +examples/bash-it/completion/available/bundler.completion.bash +examples/bash-it/completion/available/gradle.completion.bash +examples/bash-it/completion/available/drush.completion.bash +examples/bash-it/completion/available/test_kitchen.completion.bash +examples/bash-it/completion/available/hub.completion.bash +examples/bash-it/completion/available/docker-machine.completion.bash +examples/bash-it/completion/available/fabric-completion.bash +examples/bash-it/completion/available/git.completion.bash +examples/bash-it/completion/available/vagrant.completion.bash +examples/bash-it/completion/available/defaults.completion.bash +examples/bash-it/completion/available/packer.completion.bash +examples/bash-it/completion/available/salt.completion.bash +examples/bash-it/completion/available/vault.completion.bash +examples/bash-it/completion/available/docker.completion.bash +examples/bash-it/completion/available/tmux.completion.bash +examples/bash-it/completion/available/projects.completion.bash +examples/bash-it/completion/available/virsh.completion.bash +examples/bash-it/completion/available/apm.completion.bash +examples/bash-it/completion/available/git_flow.completion.bash +examples/bash-it/lib/helpers.bash +examples/bash-it/lib/preexec.bash +examples/bash-it/lib/composure.bash +examples/bash-it/lib/search.bash +examples/bash-it/themes/hawaii50/hawaii50.theme.bash +examples/bash-it/themes/iterate/iterate.theme.bash +examples/bash-it/themes/dulcie/dulcie.theme.bash +examples/bash-it/themes/colors.theme.bash +examples/bash-it/themes/rana/rana.theme.bash +examples/bash-it/themes/morris/morris.theme.bash +examples/bash-it/themes/atomic/atomic.theme.bash +examples/bash-it/themes/powerline/powerline.base.bash +examples/bash-it/themes/base.theme.bash +examples/bash-it/themes/brainy/brainy.theme.bash +examples/bash-it/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash +examples/bash-it/themes/mbriggs/mbriggs.theme.bash +examples/bash-it/themes/kitsune/kitsune.theme.bash +examples/bash-it/themes/doubletime/doubletime.theme.bash +examples/bash-it/themes/duru/duru.theme.bash diff --git a/script/parse-examples.sh b/script/parse-examples.sh new file mode 100755 index 0000000..8e2862a --- /dev/null +++ b/script/parse-examples.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +known_failures=$(cat script/known-failures.txt) + +example_files=$(find examples -name '*.sh' -or -name '*.bash') + +examples_to_parse=$( + for example in $example_files; do + if [[ ! $known_failures == *$example* ]]; then + echo $example + fi + done +) + +tree-sitter parse $examples_to_parse -q -t