Skip to content

fix: stop ignoring timer labels with a named arg, move CI to nix (#64)#3

Merged
Unisay merged 2 commits into
masterfrom
fix/console-overlay-ci
Jun 14, 2026
Merged

fix: stop ignoring timer labels with a named arg, move CI to nix (#64)#3
Unisay merged 2 commits into
masterfrom
fix/console-overlay-ci

Conversation

@Unisay

@Unisay Unisay commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes purescript-lua/purescript-lua#64.

The time, timeLog and timeEnd FFI stubs each took a label parameter s and never used it (the stub just raises "not implemented", since Lua has no console-timer API), so luacheck reported an unused argument. Renaming it to _s marks it as deliberately unused. The stubs still fail loudly, which is the intended behaviour until the timers are actually implemented (tracked separately in #2).

While here, this moves the fork off its dead npm/bower/setup-purescript CI onto the nix + overlay setup the other package-set forks already use:

  • scripts/build runs under set -euo pipefail.
  • CI builds and lints through nix develop, with luacheck pinned to --std lua51 --no-unused-args.
  • the old pulp/node scripts/test is dropped; there is no Lua-side test to run yet, and CI skips a missing scripts/test.

Verification

nix develop -c ./scripts/build compiles the fork against the Lua package set. luacheck is clean on src/ both with and without --no-unused-args, so the _s rename fixes the warning at the source rather than only suppressing it.

The `time`/`timeLog`/`timeEnd` FFI stubs took a label parameter `s` but
never used it (the stub just errors), so luacheck flagged an unused
argument. Rename it to `_s` to mark it deliberately unused; the stubs
still fail loudly because Lua has no console-timer equivalent.

Also moves CI off the dead npm/bower/setup-purescript flow onto the nix
+ overlay canon used by the other package-set forks: `scripts/build`
under `set -euo pipefail`, luacheck `--std lua51 --no-unused-args`, and
drops the broken pulp/node `scripts/test`.
@Unisay Unisay requested a review from Copilot June 14, 2026 15:18
@Unisay Unisay self-assigned this Jun 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a Lua FFI lint warning by explicitly marking the console timer label argument as unused, and migrates GitHub Actions CI from the legacy npm/bower/setup-purescript flow to a Nix-flake-based build/lint pipeline.

Changes:

  • Rename the unused label parameter for time, timeLog, and timeEnd Lua FFI stubs to _s to avoid unused-arg lint warnings.
  • Harden scripts/build by enabling set -euo pipefail.
  • Replace the existing CI workflow with a Nix-based build/test/lint flow (including luacheck invocation).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Effect/Console.lua Marks the timer label arg as intentionally unused in the Lua FFI stubs.
scripts/test Removes the legacy test runner script.
scripts/build Enables stricter bash error handling.
.github/workflows/ci.yml Switches CI to use Nix (nix develop) for build, optional test, and luacheck.
Comments suppressed due to low confidence (1)

scripts/test:1

  • scripts/test is removed, but the repo still references it (e.g. package.json has "test": "npm run build && ./scripts/test"). As-is, running npm test (or any tooling that expects this script) will fail with a missing file error. If the intention is to drop the old pulp/node tests, consider keeping a minimal placeholder script that clearly states there are no tests yet and exits successfully (or update package.json in this PR).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CI built on a 2024-03 pslua pin that wrote --lua-output-file without
creating the parent dir, so a fresh checkout failed with
`dist/Effect_Console.lua: withFile: does not exist`. Current pslua
ensures the output dir exists (the withOutputFile fix).
@Unisay Unisay merged commit 61e0116 into master Jun 14, 2026
1 check passed
@Unisay Unisay deleted the fix/console-overlay-ci branch June 14, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fork-ffi] purescript-lua-console: unused arg in timer stubs trips luacheck

2 participants