chore(types): drop LuaLS blanket disables, fix remaining hidden diagnostics#150
Merged
dlyongemallo merged 1 commit intomainfrom May 3, 2026
Merged
chore(types): drop LuaLS blanket disables, fix remaining hidden diagnostics#150dlyongemallo merged 1 commit intomainfrom
dlyongemallo merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the blanket LuaLS diagnostic disables from .luarc.json and updates type annotations/casts across the Lua codebase so strict type-checking can run cleanly again. It mostly adjusts optional fields and narrow type assertions in core VCS, UI, rendering, and utility modules that Diffview uses throughout diff and file-history flows.
Changes:
- Replaced many overly strict or inaccurate Lua annotations with optional fields/casts that better match current runtime usage.
- Updated several adapter, panel, renderer, stream, job, and utility call sites to satisfy LuaLS without changing intended behavior.
- Cleared the repo-wide LuaLS disable list in
.luarc.jsonso diagnostics are now expected to be handled locally.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
lua/diffview/vcs/rev.lua |
Tightens Rev.type annotation to use RevType. |
lua/diffview/vcs/init.lua |
Marks adapter command-context fields optional. |
lua/diffview/vcs/file.lua |
Relaxes File field annotations and normalizes extension to "". |
lua/diffview/vcs/commit.lua |
Makes commit ref names optional in typing. |
lua/diffview/vcs/adapters/p4/init.lua |
Adds typed fallback for selected_file. |
lua/diffview/vcs/adapters/null/init.lua |
Adds a cast for NullAdapter.Rev. |
lua/diffview/vcs/adapters/hg/init.lua |
Reworks HG file-history option typing/default seeding. |
lua/diffview/vcs/adapters/git/parser.lua |
Fixes optional parser fields and numeric fallback typing. |
lua/diffview/vcs/adapters/git/init.lua |
Adjusts git history option building, command args, and casts. |
lua/diffview/vcs/adapter.lua |
Updates adapter context/bootstrap/layout type annotations. |
lua/diffview/utils.lua |
Marks many utility option-table fields optional and adds casts. |
lua/diffview/ui/panel.lua |
Refines panel config typings and vim.validate type names. |
lua/diffview/ui/models/file_tree/file_tree.lua |
Makes _node back-reference optional in typing. |
lua/diffview/stream.lua |
Replaces enum helper with plain table + reverse lookup. |
lua/diffview/scene/window.lua |
Seeds attach-state keymap storage and tightens nil comparison. |
lua/diffview/scene/views/file_history/option_panel.lua |
Simplifies option assignment and adds component cast. |
lua/diffview/scene/views/file_history/file_history_panel.lua |
Adds component/layout casts in file-history panel updates. |
lua/diffview/scene/views/diff/file_panel.lua |
Adds component cast in diff file panel rendering. |
lua/diffview/scene/views/diff/diff_view.lua |
Asserts fs-poll handle creation for index watching. |
lua/diffview/scene/layouts/diff_1_inline.lua |
Adds buffer-number casts in inline diff paths. |
lua/diffview/scene/file_entry.lua |
Broadens adapter typing and normalizes extension typing. |
lua/diffview/renderer.lua |
Corrects highlight-list type annotations. |
lua/diffview/perf.lua |
Refines lap-entry typing and string conversion. |
lua/diffview/path.lua |
Marks normalize options optional. |
lua/diffview/logger.lua |
Replaces outfile-status enum helper and relaxes log option typing. |
lua/diffview/lib.lua |
Adds typed casts for parsed -C flag values. |
lua/diffview/lazy.lua |
Broadens lazy helper return annotations to any. |
lua/diffview/job.lua |
Tightens pipe creation asserts and signal typing. |
lua/diffview/hl.lua |
Makes highlight spec/data fields optional and adds cast. |
lua/diffview/config.lua |
Updates config type comments and HG log-option defaults. |
lua/diffview/arg_parser.lua |
Refines flag/scan type annotations and return casts. |
lua/diffview/actions.lua |
Makes compatibility fold command list optional. |
.luarc.json |
Removes the blanket LuaLS disabled diagnostics list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
59b8a3b to
26c8568
Compare
26c8568 to
70ed55e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.