Skip to content

.lashignore is undiscoverable: not in --help, config, or the W_INDEX_ORPHAN message #58

Description

@fohara

.lashignore already does exactly what I needed, and I could not find it from anywhere lash points you.

What happened

I added a content/ directory of non-task Markdown to a project that uses lash (prose that ships with the site, not tasks). Every file in it now shows up in lash lint:

warning[W_INDEX_ORPHAN]: File '/…/content/writing/a-post.md' is not referenced in the root index
  at /…/content/writing/a-post.md:0:0

One warning per file, growing by one with every post, in a directory that will never contain a task.

Looking for a way to exclude it, I checked lash --help, lash lint --help, and lash config list. None of them mention any ignore or exclude mechanism, so I concluded there wasn't one and wrote a note in our own docs telling people to read past the warnings.

That was wrong. .lashignore is implemented, works, and is exactly right:

$ printf 'content/\n' > .lashignore
$ lash lint     # content warnings gone, 5 warnings -> 4

It's honored in both lash-db/src/walker.rs:399 and lash-cli/src/utils/file_discovery.rs:64, it has a test (test_lashignore_respect), and lash's own repo uses one — lash.index.md:16 mentions it in passing. It just isn't reachable from any surface a user is looking at when they hit the warning.

Suggested fix

Wherever it is cheapest:

  • Mention .lashignore in lash lint --help (and ideally in the top-level --help where .gitignore behavior would be described).
  • Say it in the W_INDEX_ORPHAN message itself: not referenced in the root index (add to .lashignore if this is not a task file). That is where the user actually is, and it would have saved the whole detour.
  • Cover it in the README/user docs; today it only appears in docs/agent-workflows.md, devlog.md, and tasks/.

Second, separable thing

While chasing the above, lash explain — the one place the diagnostic output tells you to go — does not know the codes that lash lint actually emits:

$ lash explain W_INDEX_ORPHAN
Error: Unknown error code 'W_INDEX_ORPHAN'
Run 'lash explain --list' to see all available error codes.

$ lash explain E_LINK_NOT_FOUND
Error: Unknown error code 'E_LINK_NOT_FOUND'

--list shows 46 codes, of which exactly one is a warning (W_SEM_DOC_FRAGMENT). So a user who follows the advice in the error output lands on a dead end at the moment they are already confused. Happy to split this into its own issue if you'd rather track it separately.

Environment

lash 0.4.0 (Homebrew/cargo install, macOS 15.5). Project has a root lash.index.md and task files under tasks/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions