commands.article calls fs.abspath before checking path #162

Closed
opened 2026-11-24 13:51:46 +01:00 by michael · 1 comment
Owner

Goal

The argument check comes before any use of path.

Reason

commands.article calls mod_fs.abspath(path) before if not path; found in DAW/fragjan#157.

Scope

  • reorder the check in core/commands/article.lua

Acceptance criteria

  • call without path returns a daw_error/v1
  • test for it

Refs DAW/fragjan#157

## Goal The argument check comes before any use of `path`. ## Reason `commands.article` calls `mod_fs.abspath(path)` before `if not path`; found in DAW/fragjan#157. ## Scope - reorder the check in `core/commands/article.lua` ## Acceptance criteria - [ ] call without path returns a daw_error/v1 - [ ] test for it Refs DAW/fragjan#157
Collaborator

Summary

  • core/commands/article.lua: the path required check now runs first, before daw.common.fs is loaded and before mod_fs.abspath(path).
  • test/test_commands_article.lua: the fake fs.abspath now fails on nil like the real fs; new check that abspath is not called when path is missing.

Commits: 616d0b5 (fix), 91d9955 (test).

Tests

  • Lua 5.1 and 5.4: test_commands_article.lua 16/16 passed.
  • Counter-check: with the old handler code the new test fails (2 failed).
  • Full suite (each test/test_*.lua run directly): 31/42 files pass on 5.1 and 5.4, identical to develop before the change. The 11 failing files fail on develop too (unrelated to this issue).
  • Note: make test could not run in the cloud checkout: tools/run_tests.sh is not in the repo, and test/helpers.lua is a symlink to a local path. A minimal stand-in for helpers.summarize was used outside the repo. Please confirm with make test locally.

Branch

claude/issue-162 (based on develop, no PR)

Refs DAW/fragjan#162

## Summary - `core/commands/article.lua`: the `path required` check now runs first, before `daw.common.fs` is loaded and before `mod_fs.abspath(path)`. - `test/test_commands_article.lua`: the fake `fs.abspath` now fails on `nil` like the real fs; new check that `abspath` is not called when path is missing. Commits: `616d0b5` (fix), `91d9955` (test). ## Tests - Lua 5.1 and 5.4: `test_commands_article.lua` 16/16 passed. - Counter-check: with the old handler code the new test fails (2 failed). - Full suite (each `test/test_*.lua` run directly): 31/42 files pass on 5.1 and 5.4, identical to `develop` before the change. The 11 failing files fail on `develop` too (unrelated to this issue). - Note: `make test` could not run in the cloud checkout: `tools/run_tests.sh` is not in the repo, and `test/helpers.lua` is a symlink to a local path. A minimal stand-in for `helpers.summarize` was used outside the repo. Please confirm with `make test` locally. ## Branch `claude/issue-162` (based on `develop`, no PR) Refs DAW/fragjan#162
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/fragjan#162
No description provided.