Skip to content

Commit fa701e1

Browse files
committed
feat(v1.3.0): release
* refactor(github): templates * (fix) add missing comma to example conf Donated by Lucas Parry <[email protected]> * chore(*): formatting; minor typo * feat(tests): basic testing harness; few config test * refactor(doc): convert mk to Makfile in doc/ * feat(config): enable/disable via vim.g.lspTimeoutLoade * ci(*): brief PR template; minor refacto * refactor(make): better make structutr * chore(*): update git & tools dotfile * test(*): minor updat * docs(*): formattin * fix: typo and extra word in `README.md` Closes: #18 * chore(*): update hooks, lua_ls, tests, tools * feat(checkheatlh): support checkhealth
1 parent 6325906 commit fa701e1

31 files changed

+899
-390
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
*.mp3 binary diff=
99
*.mp4 binary diff=
1010
*.mov binary diff=
11+
*.ogv binary diff=
12+
*.mkv binary diff=
1113
*.xcf binary diff=
1214
*.zip binary diff=
1315
*.tar.gz binary diff=
14-

.githooks/pre-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/bash
2+
3+
# building docs
4+
make -sr -C doc/ all
5+
git add doc/
6+
source "$(dirname ${0})/pre-commit.no-logs"
7+
no_logs '^[[:space:]]*print(?' tests/**/*.lua # lua: disallow print() expressions
8+
no_logs '^[[:space:]]*print(?' lua/**/*.lua # lua: disallow print() expressions
9+
# disallow logs end
10+
# hook end

.githooks/pre-commit.no-logs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env -S bash
2+
# File........: pre-commit.check-logs
3+
# Summary.....: Abort committing if logging expressions are found in source files
4+
# Created.....: December 07, 2023
5+
# Authors.....: Alex A. Davronov <[email protected]> (2023-)
6+
# Usage.......: Import by using `source` (or `.`) in a shellscript:
7+
# source "\$(dirname \${0})/pre-commit.no-logs"
8+
# # JavaScript
9+
# no_logs '^[[:space:]]*console.log\(.*'
10+
# no_logs '^[[:space:]]*debug' src/**/*.{js,ts}
11+
# # C/C++
12+
# no_logs '^[[:space:]]*printf\(?.*' src/**/*.cc
13+
# no_logs '^[[:space:]]*(std)?::cout[[:space:]]*<<.*' src/**/*.cc
14+
# # Lua
15+
# no_logs '^[[:space:]]*print\(?.*vim.inspect\(?.*' lua/**/*.lua
16+
# # Shell
17+
# no_logs '^[[:space:]]*declare\s*-p\s*.*' **/*.{sh,zsh,bash}
18+
19+
## Returns non-zero if specified files contain given string
20+
## @param check_string
21+
## @param ... files
22+
no_logs(){
23+
local _CTX="pre-commit.no-logs"
24+
local _REG=${1:? string (.e.g "console.log") is required}
25+
shift
26+
27+
local _FILES=()
28+
local _GIT_FILES=($(git di --staged --name-only --diff-filter=CRAM))
29+
# only pickup what was staged so for
30+
for file in ${@}; do
31+
for file_staged in ${_GIT_FILES[@]};
32+
do
33+
[[ "${file}" =~ "${file_staged}" ]] && _FILES+=("$file")
34+
done
35+
done
36+
(( ${#_FILES[@]} == 0 )) && { return 0; };
37+
local _GRP=$(grep --color=always -n -s -E "${_REG}" ${_FILES[@]} )
38+
# printf "${_CTX} checking for ${_REG}... "
39+
if [[ -n ${_GRP} ]] ;
40+
then
41+
printf "\n${_GRP}\n"
42+
printf "${_CTX}:$(tput setaf 1)error$(tput sgr0): ${_REG} - logs are likely not needed. Aborting.\n" >&2 ;
43+
exit 1
44+
# else
45+
# printf "\n${0}:$(tput setaf 2) ok ✔$(tput sgr0)\n"
46+
fi
47+
}
48+
49+
# ex: ft=bash

.githooks/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/bash
2+
echo -en "$0: configuring git... "
3+
git config core.hooksPath ".githooks"
4+
echo -e "$(tput setaf 2)done!$(tput op)"

.github/ISSUE_TEMPLATE/issue-bug.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
- type: checkboxes
99
id: issue-trouble-is-read
1010
attributes:
11-
label: I've read TROUBLESHOOTING instructions
11+
label: I've read TROUBLESHOOTING](../blob/main/doc/index.md#TROUBLESHOOTING) instructions
1212
options:
1313
- label: "Yes"
1414
required: true
@@ -26,6 +26,13 @@ body:
2626
placeholder: Specify how to reproduce issue if there are any ways
2727
validations:
2828
required: false
29+
- type: textarea
30+
id: issue-checkhealth
31+
attributes:
32+
label: checkhealth output
33+
placeholder: Run `checkhealth lsp-timeout` and paste
34+
validations:
35+
required: true
2936
- type: textarea
3037
id: issue-env
3138
attributes:
@@ -44,9 +51,9 @@ body:
4451
options:
4552
- Linux/Debian/Ubuntu
4653
- Linux/Debian/Kubuntu
47-
- Linux / Other
48-
- Archlinux
49-
- NixOS
54+
- Linxu/Archlinux
55+
- Linux/NixOS
56+
- Linux/Other
5057
- MacOS
5158
- Windows
5259
- Windows WSL

.github/pull_request_template.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
! MERGE AGAINST `DEV` BRANCH, NOT `MAIN`
2-
31
### LEGAL & CONTEXT
2+
- [ ] I'M MERGING AGAINST `DEV` BRANCH
43
- [ ] I've read the [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) and I'm fully aware of the terms
54
- [ ] I've read the [LICENSE](../blob/main/LICENSE) and fully accept the terms and waive my rights over this contribution
6-
- [ ] I've [DISCUSSED](../discussions) this proposal or feature earlier (optional)
5+
- [ ] I've [DISCUSSED](../discussions) this earlier or have opened an issue (optional)
76

87
### SUMMARY
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: dev
22
on:
3-
# Trigger worfklow when branch or tags are pushed
43
push:
54
branches:
65
- dev
6+
paths:
7+
- "lua/**"
8+
- "plugin/**"
9+
- "tests/**"
710
pull_request:
811
branches: [ "dev", "main" ]
912
paths:
@@ -14,11 +17,18 @@ jobs:
1417
tests:
1518
name: Run ALL lua tests
1619
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
shell: bash
1723
steps:
1824
- name: Checkout git repository
1925
uses: actions/checkout@v4
2026
- name: Run tests
2127
shell: bash
22-
# CONTINUE: [November 01, 2023] Provide basic testing workflow
2328
run: |
24-
make -sR -C tests/
29+
git branch --show-current
30+
# Only four versions are tested:
31+
# v0.7.2 v0.8.3 v0.9.2 nightly
32+
# They are setup by NEOVIM_VERSIONS
33+
# Testing is done incrementally
34+
make -sR tests/

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ out/
1010
dist/
1111
.dist/
1212
.git/
13+
# nvim
14+
.vim/
15+
.nvim/
1316
# node.js
1417
node_modules/
15-
# scaffold tooling
16-
.scaffoldrc

.gitmodules

Whitespace-only changes.

.luarc.json

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
{
2-
"schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3-
"runtime": [ "lua/?.lua" ],
4-
"workspace.library": [ "/usr/local/share/nvim/runtime/lua" ],
5-
"format.enable": false,
6-
"workspace.checkThirdParty": false
2+
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3+
"runtime": {
4+
"version": "LuaJIT",
5+
"path": [
6+
"lua/?.lua",
7+
"lua/?/init.lua",
8+
"/usr/local/share/nvim/runtime/lua/?.lua"
9+
10+
]
11+
},
12+
"workspace": {
13+
"library": [
14+
"/usr/local/share/nvim/runtime/lua/vim/_meta/vimfn.lua",
15+
"/usr/local/share/nvim/runtime/lua/vim/_options.lua",
16+
"/usr/local/share/nvim/runtime/lua/vim/_meta/api.lua",
17+
"/usr/local/share/nvim/runtime/lua/vim/_meta/vvars.lua",
18+
"/usr/local/share/nvim/runtime/lua/vim/_meta/vvars_extra.lua",
19+
"/usr/local/share/nvim/runtime/lua/vim/_meta/lpeg.lua",
20+
"/usr/local/share/nvim/runtime/lua/vim/_meta/builtin.lua",
21+
"/usr/local/share/nvim/runtime/lua/vim/_meta/builtin_types.lua",
22+
"/usr/local/share/nvim/runtime/lua/vim/_meta/api_keysets.lua",
23+
"/usr/local/share/nvim/runtime/lua/vim/_meta/api_keysets_extra.lua",
24+
"/usr/local/share/nvim/runtime/lua/vim/_meta/base64.lua",
25+
"/usr/local/share/nvim/runtime/lua/vim/_meta/diff.lua",
26+
"/usr/local/share/nvim/runtime/lua/vim/_meta/regex.lua",
27+
"/usr/local/share/nvim/runtime/lua/vim/_meta.lua",
28+
"$HOME/.local/share/nvim/lazy/plenary.nvim/"
29+
],
30+
"checkThirdParty": false,
31+
"userThirdParty": [
32+
]
33+
},
34+
"diagnostics": {
35+
"globals": [
36+
"vim"
37+
],
38+
"disable": [
39+
"unused-local",
40+
"unused-vararg"
41+
]
42+
},
43+
"format.enable": false
744
}

0 commit comments

Comments
 (0)