Skip to content

Commit f5dac7d

Browse files
committed
refactor: clean up chatty comments and improve code maintainability
- Remove procedural comments that describe obvious code actions - Eliminate redundant explanatory text in function documentation - Replace repeated logger require calls with cached variables - Fix luacheck warning about inefficient loop pattern - Add comprehensive test coverage for edge cases and error handling - Preserve valuable comments that explain "why" not "what" All tests pass (215 successes) with 0 warnings/errors across 61 files. Change-Id: I0c4a606f8508ecc98a6f4202f83bbf5b3599daf6 Signed-off-by: Thomas Kosiewski <[email protected]>
1 parent a428ceb commit f5dac7d

File tree

8 files changed

+1367
-253
lines changed

8 files changed

+1367
-253
lines changed

lua/claudecode/config.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ M.defaults = {
1717
},
1818
}
1919

20-
--- @param config table The configuration table to validate.
20+
--- Validates the provided configuration table.
21+
-- @param config table The configuration table to validate.
22+
-- @return boolean true if the configuration is valid.
23+
-- @error string if any configuration option is invalid.
2124
function M.validate(config)
2225
assert(
2326
type(config.port_range) == "table"
@@ -50,7 +53,6 @@ function M.validate(config)
5053
"visual_demotion_delay_ms must be a non-negative number"
5154
)
5255

53-
-- Validate diff_opts
5456
assert(type(config.diff_opts) == "table", "diff_opts must be a table")
5557
assert(type(config.diff_opts.auto_close_on_accept) == "boolean", "diff_opts.auto_close_on_accept must be a boolean")
5658
assert(type(config.diff_opts.show_diff_stats) == "boolean", "diff_opts.show_diff_stats must be a boolean")
@@ -60,7 +62,9 @@ function M.validate(config)
6062
return true
6163
end
6264

63-
--- @param user_config table|nil The user-provided configuration table.
65+
--- Applies user configuration on top of default settings and validates the result.
66+
-- @param user_config table|nil The user-provided configuration table.
67+
-- @return table The final, validated configuration table.
6468
function M.apply(user_config)
6569
local config = vim.deepcopy(M.defaults)
6670

lua/claudecode/diff.lua

Lines changed: 193 additions & 214 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)