Remove orphaned Lua filter entry points (quarto-pre.lua, crossref-standalone.lua)#14704
Conversation
…ndalone.lua) These two standalone pandoc `--lua-filter` entry points are dead code: nothing in the codebase invokes them, and one can no longer even load. Removing them prevents future maintainers from mistakenly resurrecting a broken entry point. ## Provenance `src/resources/filters/quarto-pre/quarto-pre.lua` - The pre/post filter passes were consolidated into the custom-AST `main.lua` pipeline in PR quarto-dev#3694 "Feature: custom AST nodes" (commit 56888bb, 2022-12-19). That commit removed the `filters.ts` invocations of BOTH `quarto-pre/quarto-pre.lua` and `quarto-post/quarto-post.lua`, and deleted `quarto-post/quarto-post.lua` from disk -- but left `quarto-pre.lua` behind. (`quarto-post.lua` had first been removed as unused back in 2020, commit b58522f, then briefly reintroduced.) - It has had zero references outside itself since then. - It is additionally non-loadable: line 51 does `import("code.lua")`, but `src/resources/filters/quarto-pre/code.lua` has never existed at that path. Subsequent mechanical Lua refactors edited the file without noticing the dangling import -- because nothing ever executes it. `src/resources/filters/crossref/crossref-standalone.lua` - Created in commit 80548e6 "recreate quarto-init and crossref for IDE support" (2023-01-02) but never wired up: the string "crossref-standalone" appears in no other file in the entire history. IDE crossref support uses `crossref/crossref.lua` (src/command/editor-support/crossref.ts), not this file. ## Verification - Confirmed zero references to either basename across all files at HEAD (`.ts`, `.lua`, build configs, workspace files). - Built the dev bundle and confirmed removal breaks nothing: `quarto render` to html/typst and `quarto editor-support crossref` all succeed unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014YbHWoK9NL6ms3BLQkC3Xe
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
I think they're not ok to remove. Have Claude check quarto-dev/quarto for standalone filter usage from the visual editor and extensions. |
Oh cross project usage !! Tricky - I'll definitely add a note somewhere in the file that this could happen and it would avoid future claude to tell me it could deleted them 😅 I was glad to verify this - I'll check and report. |
|
Yeah, I've made that mistake before too :) We have cross-project dependencies on quarto-dev/quarto and rstudio/rstudio (though I think not applicable in this particular case). It would be great to coordinate and write those down. |
The visual editor (quarto-dev/quarto) and RStudio (rstudio/rstudio) invoke Quarto's crossref/xref filters standalone against the installed share tree, so "no in-repo reference" does not prove a shipped filter is dead code. Record the touch-points and a removal checklist: - .claude/rules/filters/cross-project-consumers.md -- path-scoped guardrail that surfaces automatically when editing src/resources/filters/** or the packaging inline list. - dev-docs/cross-project-dependencies.md -- coordination reference listing the quarto-dev/quarto and rstudio/rstudio touch-points on quarto-cli. Context: verified crossref-standalone.lua and quarto-pre.lua were safe to remove (never in the packaging inline list, so never shipped; both consumers load crossref.lua/quarto-init.lua instead). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01337kruURGowoAH9pzVA3rf
|
So I had 🤖 checked the cross-project usage, and it turns out the two files are safe to remove. The standalone-filter concern is real, but it points at
Consumers:
Neither references The decisive check: what actually ships.
Writing it down: added on this branch —
So future 🤖 gets warned before assuming a filter is dead. |
@cscheid does it seems ok to remove to you ? I believe so
🤖 analysis ⬇️
Description
Removes two standalone pandoc
--lua-filterentry points that are dead code — nothing in the codebase invokes them, and one can no longer even load. Removing them prevents a future maintainer from resurrecting a broken entry point.src/resources/filters/quarto-pre/quarto-pre.luamain.luapipeline in PR Feature: custom AST nodes #3694 "Feature: custom AST nodes" (commit56888bb9, 2022-12-19). That commit removed thefilters.tsinvocations of bothquarto-pre/quarto-pre.luaandquarto-post/quarto-post.lua, and deletedquarto-post/quarto-post.luafrom disk — but leftquarto-pre.luabehind. (quarto-post.luahad first been removed as unused in 2020, commitb58522fc, then briefly reintroduced.)import("code.lua"), butsrc/resources/filters/quarto-pre/code.luahas never existed at that path. Later mechanical Lua refactors edited the file without noticing the dangling import — because nothing ever executes it.src/resources/filters/crossref/crossref-standalone.lua80548e60"recreate quarto-init and crossref for IDE support" (2023-01-02) but never wired up: the stringcrossref-standaloneappears in no other file in the entire history. IDE crossref support usescrossref/crossref.lua(src/command/editor-support/crossref.ts), not this file.Verification
HEAD(.ts,.lua, build configs, workspace files).quarto renderto html/typst andquarto editor-support crossrefall succeed unchanged.Checklist
I have (if applicable):
AI-assisted PR
githistory analysis; built dev bundle for runtime verification