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 <lucas.parry@ferocia.com.au> * 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

+2-1
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

+10
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

+49
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 <al.neodim@gmail.com> (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

+4
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

+11-4
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

+2-3
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

+3-2
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

+42-5
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
}

.mailmap

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Used by git shortlog - maps different names to a single author
2+
hinell <al.neodim@gmail.com>
3+
Hinell <al.neodim@gmail.com>
4+
Alexander A. Davronov <al.neodim@gmail.com>
5+
Alex A. Davronov <al.neodim@gmail.com>
6+
Alex A. D. <al.neodim@gmail.com>

.scaffoldrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ex: ft=bash
2+
# AUTOGENARTED BY SCAFFOLD TOOLSET
3+
SC_VERSION=1.1.1
4+
CREATED_AT="Mon, 23 Oct 2023 12:50:27 +0300"
5+
UPDATED_AT="Thu, 26 Oct 2023 08:49:17 +0300"
6+
DOC_PROJECT_NAME="lsp-timeout.nvim"
7+
DOC_PROJECT_SUMMARY="Nvim plugin for nvim-lspconfig: stop idle servers & restart upon gaining or loosing focus;keeps your RAM usage low;"
8+
DOC_LICENSE_TYPE="Free and Open Source Software [International] License (FOSSIL) v1.0.2"
9+
NVIM_PLUGIN_MODULE_NAME="lsp-timeout"
10+
GIT_REPO_URL_USER="git"
11+
GIT_REPO_URL_HOST="github.com"
12+
GIT_REPO_URL_PATH="hinell/lsp-timeout.nvim"
13+
GIT_REPO_URL_SCP="git@github.com:hinell/lsp-timeout.nvim.git"
14+
GIT_HOOKS_FOLDER=".githooks"
15+
LICENSE_PATH="/home/alex/.local/share/scaffold/templates/license/fossil-v1.0.2.txt.in"
16+
GIT_USERNAME="hinell"
17+
GIT_USEREMAIL="al.neodim@gmail.com"

CONTRIBUTING.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# CONTRIBUTING
22

3-
This project is open-source, meaning you can make as many copies of it as you want and do whatever you want with the code as long as you are not trying to commercialize it, but it does NOT encourage contributions. In order to keep this library in the public domain and ensure that the code does not become contaminated with proprietary or strictly-licensed content or code that is hard to maintain, the project does not accept patches from people who have not submitted an affidavit dedicating their contribution to the author of this project or public domain.
3+
### Open-source, not Open-contributing
4+
This project is Open-source, meaning you can make as many copies of it as you want and do whatever you want with the code as long as you are not trying to commercialize it, but it IS NOT open-contribution. In order to keep this library in the public domain and ensure that the code remains usable and does not become contaminated with proprietary or strictly-licensed content or code that is hard to maintain, the project does not accept patches from people who have not submitted an affidavit dedicating their contribution to the author of this project or public domain.
45

56
All of the code have been written specifically for use by it; NO code has been copied from unknown sources on the internet unless explicitly specified.
67

7-
If your contribution is ever accepted, then:
8-
* You waive all your legal rights to any textual or visual contribution you make to this project
9-
* You wholly transfer the said rights to the author of this project
10-
* You admit that the said contribution is subject to change and may be changed beyound recognition
8+
### Alternatives: plugins
9+
The project is open for requests to expose APIs for plugins so you can safely extend it by maintaining a separate project. Consider creating a plugin instead of a requesting merging with your fork.
10+
11+
### If your contribution is ever accepted
12+
If your contribution is ever accepted, You:
13+
* waive all your legal rights to any textual or visual contribution you make to this project
14+
* wholly transfer the said rights to the author of this project
15+
* accept the fact that the said contribution is subject to change and may be changed beyound recognition
16+
1117

1218
## SEE ALSO
1319
> [LICENSE](LICENSE)<br/>
14-
> [SQLite Disclaimer](https://www.sqlite.org/copyright.html)<br/>
20+
> [SQLite Disclaimer](https://www.sqlite.org/copyright.html)<br/> - an influential provision worth checking.
1521
> [Open Source is Not About You](https://gist.github.com/richhickey/1563cddea1002958f96e7ba9519972d9)
1622
# [DEVELOPMENT](./DEVELOPMENT.md)
1723

1824
----
19-
October 26, 2023</br>
25+
December 24, 2023</br>
2026
Copyright © 2023 - Alexander Davronov (a.k.a. github@hinell), et.al.<br>

0 commit comments

Comments
 (0)