Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .luarc-typecheck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"runtime": { "version": "LuaJIT" },
"workspace": {
"useGitIgnore": false,
"library": ["vendor"],
"ignoreDir": [".claude", ".git", ".idea", ".venv", "build", "dist", "node_modules", "vendor"]
},
"diagnostics": { "disable": ["unnecessary-assert"] }
}
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,17 @@ lint:
# Deliberately NOT part of `check`: a handful of type-narrowing and
# deliberate-bad-argument diagnostics remain, and turning CI red on those is a
# separate decision from making the check runnable.
#
# Checks the whole repo, not just src/: an editor's workspace is the repo, and
# @alias resolves workspace-wide, so a narrower scope gives different findings
# rather than fewer. --configpath pins the config, because .luarc.json is
# personal editor preference and the count moves with it.
.PHONY: typecheck
typecheck:
@if command -v lua-language-server >/dev/null 2>&1; then \
echo "Running lua-language-server..."; \
lua-language-server --check "$(CURDIR)/src" --checklevel=Warning --logpath="$(CURDIR)/build/luals"; \
echo "Running lua-language-server $$(lua-language-server --version)..."; \
lua-language-server --check "$(CURDIR)" --checklevel=Warning \
--configpath="$(CURDIR)/.luarc-typecheck.json" --logpath="$(CURDIR)/build/luals"; \
else \
echo "lua-language-server not found. Install with: make install-deps"; \
exit 1; \
Expand Down
9 changes: 5 additions & 4 deletions src/crypto/annotations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
--- `crypto.init`) does not bundle it and the shipped builds are unchanged.
---
--- Do not add runtime code here. Types used by a single module stay in that
--- module, next to what they describe.
--- module, next to what they describe, and a type already defined in `vendor/`
--- stays there rather than being restated here.

-- ----------------------------------------------------------------------------
-- Curve25519 field arithmetic
Expand All @@ -27,6 +28,6 @@
-- ----------------------------------------------------------------------------
-- Lua 5.1/5.2 have no 64-bit integers and 5.3+ `//` semantics differ, so the
-- 64-bit primitives (SHA-512, BLAKE2b) carry 64-bit quantities as a pair of
-- 32-bit halves. Used by `utils/bytes`, `sha512` and `blake2`.

--- @alias Int64HighLow { [1]: integer, [2]: integer } 64-bit value as {high, low} 32-bit halves
-- 32-bit halves, used by `utils/bytes`, `sha512` and `blake2`.
--
-- Int64HighLow is defined in vendor/bitn.lua, where these halves come from.
Loading