Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@
## 2025-01-24 - ๋‹จ์ผ readAttributes ํ˜ธ์ถœ๋กœ ํŒŒ์ผ ์†์„ฑ ์กฐํšŒ ์ตœ์ ํ™”
**ํ•™์Šต:** `isDirectory`, `!it.isDirectory()`, `isSymbolicLink` 3๊ฐœ์˜ ๊ฐœ๋ณ„์ ์ธ ํŒŒ์ผ ์‹œ์Šคํ…œ I/O ํ˜ธ์ถœ์„ ์ˆ˜ํ–‰ํ•˜๋ฉด ์„ฑ๋Šฅ ์ €ํ•˜๊ฐ€ ํฝ๋‹ˆ๋‹ค. ์ด๋ฅผ ๋‹จ์ผ `Files.readAttributes` ํ˜ธ์ถœ๋กœ ๋ณ€๊ฒฝํ•˜์—ฌ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ํ•œ ๋ฒˆ์— ์กฐํšŒํ•จ์œผ๋กœ์จ I/O ์˜ค๋ฒ„ํ—ค๋“œ๋ฅผ ๋Œ€ํญ ์ค„์ผ ์ˆ˜ ์žˆ์Œ์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.
**์กฐ์น˜:** ๋””๋ ‰ํ† ๋ฆฌ ์ˆœํšŒ ์‹œ ํŒŒ์ผ์˜ ์—ฌ๋Ÿฌ ์†์„ฑ์„ ํ™•์ธํ•  ๋•Œ๋Š” ๊ฐœ๋ณ„์ ์ธ stat ํ˜ธ์ถœ๋ณด๋‹ค `Files.readAttributes`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•„์š”ํ•œ ๋ชจ๋“  ์†์„ฑ์„ ํ•œ ๋ฒˆ์— ๊ฐ€์ ธ์˜ค๋Š” ๋ฐฉ์‹์„ ์šฐ์„ ์ ์œผ๋กœ ๊ณ ๋ คํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
## 2026-07-24 - ๋ฃจํ”„ ๋‚ด๋ถ€์˜ ๋ถˆ๋ณ€๊ฐ’ ์—ฐ์‚ฐ ํ˜ธ์ด์ŠคํŒ…
**ํ•™์Šต:** `process_dir`์™€ ๊ฐ™์ด ์ž์ฃผ ํ˜ธ์ถœ๋˜๋Š” ํ•จ์ˆ˜ ๋‚ด๋ถ€์—์„œ ๋ณ€ํ•˜์ง€ ์•Š๋Š” ์ •์  ๋ฌธ์ž์—ด ํ• ๋‹น์ด๋‚˜ ๋ฌด๊ฑฐ์šด ์—ฐ์‚ฐ(์˜ˆ: SHA-256 ํ•ด์‹œ ๊ณ„์‚ฐ)์„ ์ˆ˜ํ–‰ํ•˜๋ฉด ๋งค๋ฒˆ ํ˜ธ์ถœ ์‹œ๋งˆ๋‹ค ์ค‘๋ณต๋œ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น ๋ฐ ์ฒ˜๋ฆฌ ๋น„์šฉ์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
**์กฐ์น˜:** ๋ถˆ๋ณ€ ์ •์  ๋ฌธ์ž์—ด๊ณผ ๋น„์šฉ์ด ํฐ ์—ฐ์‚ฐ๋“ค์€ ์ž์ฃผ ํ˜ธ์ถœ๋˜๋Š” ํ•จ์ˆ˜ ๋ฐ”๊นฅ(์ตœ์ƒ์œ„ ๋ ˆ๋ฒจ)์œผ๋กœ ํ˜ธ์ด์ŠคํŒ…ํ•˜์—ฌ `private val` ์ƒ์ˆ˜๋กœ ์„ ์–ธํ•จ์œผ๋กœ์จ ๋ถˆํ•„์š”ํ•œ ๋ฐ˜๋ณต ์˜ค๋ฒ„ํ—ค๋“œ๋ฅผ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค. Kotlin์—์„œ `private val`์„ ์‚ฌ์šฉํ•˜๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ ์ƒ์„ฑ๋˜๋Š” public getter ๋ฉ”์„œ๋“œ๋ฅผ ๋ฐฉ์ง€ํ•˜์—ฌ ์ปค๋ฒ„๋ฆฌ์ง€(Jacoco) ๊ฐ์†Œ๋„ ๋ง‰์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
16 changes: 9 additions & 7 deletions src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,9 @@ fun write_index_file(curr_dir: File, content: String) {
}
}

fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array<File>? = null){

val exclude: Set<String> = excludeSet ?: process_ignore_file(curr_dir)

val cssContent = """
// โšก Bolt Performance Optimization: Hoisted static CSS strings and expensive SHA-256 computation
// to top-level `private val`s to prevent redundant allocations and processing overhead per directory.
private val cssContent = """
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
line-height: 1.5;
Expand Down Expand Up @@ -310,13 +308,17 @@ fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array
}
"""

val styleHash = "sha256-" + Base64.getEncoder().encodeToString(MessageDigest.getInstance("SHA-256").digest(cssContent.toByteArray(Charsets.UTF_8)))
private val styleHash = "sha256-" + Base64.getEncoder().encodeToString(MessageDigest.getInstance("SHA-256").digest(cssContent.toByteArray(Charsets.UTF_8)))

val css = """
private val css = """
<style>
${cssContent} </style>
"""
Comment on lines +313 to 316

fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array<File>? = null){

val exclude: Set<String> = excludeSet ?: process_ignore_file(curr_dir)

val index_top = """<!doctype html>
<html lang="ko">
<head>
Expand Down
Loading