From 98c0efba44b6915ea5ecbf7fe50fde1fcfeb9ff5 Mon Sep 17 00:00:00 2001 From: Spencer Brower <6729162+sbrow@users.noreply.github.com> Date: Wed, 29 Jul 2026 10:22:16 -0400 Subject: [PATCH] style: Ran `odinfmt`. --- bench/bench.odin | 73 ++++++++++------ bench/date/check.odin | 1 - bench/date/common/types.odin | 1 - bench/date/inlined/format.odin | 1 - bench/date/inplace/format.odin | 1 - bench/date/original/format.odin | 1 - bench/date/parse.odin | 1 - bench/date/returned/format.odin | 1 - content.odin | 14 +++- defaults.odin | 1 - feed.odin | 1 - frontmatter.odin | 25 +++--- html_test.odin | 4 +- it/it.odin | 1 - main.odin | 1 - main_test.odin | 1 - markdown/alerts.odin | 1 - markdown/alerts_test.odin | 1 - markdown/emoji.odin | 1 - markdown/emoji_test.odin | 1 - markdown/footnotes.odin | 1 - markdown/footnotes_test.odin | 1 - markdown/heading_ids.odin | 1 - markdown/heading_ids_test.odin | 18 ++-- markdown/highlight.odin | 1 - markdown/markdown.odin | 1 - markdown/sectionate.odin | 1 - markdown/sectionate_test.odin | 1 - menus.odin | 1 - minify.odin | 42 +++++----- mustache/data.odin | 1 - mustache/diagnostic.odin | 1 - mustache/diagnostic_test.odin | 1 - mustache/format.odin | 1 - mustache/format_test.odin | 143 ++++++++++++++++++++++++++------ mustache/lambda_test.odin | 1 - mustache/mustache.odin | 1 - mustache/mustache_test.odin | 1 - mustache/pipes.odin | 13 ++- mustache/pipes_test.odin | 40 +++++---- mustache/spec_test.odin | 1 - mustache/suggest.odin | 5 +- mustache/suggest_test.odin | 1 - mustache/tokenizer.odin | 14 +--- opengraph.odin | 1 - render.odin | 1 - site.odin | 1 - site_test.odin | 8 +- treesitter/treesitter.odin | 12 ++- vfs.odin | 1 - 50 files changed, 269 insertions(+), 179 deletions(-) diff --git a/bench/bench.odin b/bench/bench.odin index 4c15d3c..3350734 100644 --- a/bench/bench.odin +++ b/bench/bench.odin @@ -1,11 +1,11 @@ package bench +import "../mustache" import "core:fmt" import "core:mem" import "core:os" import "core:strconv" import "core:time" -import "../mustache" Tag :: struct { name: string, @@ -101,13 +101,13 @@ main :: proc() { return } - for _ in 0..<3 { + for _ in 0 ..< 3 { _, _ = mustache.render(page, data, partials, allocator = context.temp_allocator) mem.dynamic_arena_free_all(&temp_arena) } start := time.now() - for _ in 0.. mustache.Template { @@ -138,16 +142,27 @@ parse_file :: proc(name: string) -> mustache.Template { } generate_data :: proc() -> Page_Data { - years := []string{ - "2025", "2024", "2023", "2022", "2021", - "2020", "2019", "2018", "2017", "2016", + years := []string { + "2025", + "2024", + "2023", + "2022", + "2021", + "2020", + "2019", + "2018", + "2017", + "2016", } posts := make([dynamic]Post, 0, 500) for year in years { - for i in 0..<50 { + for i in 0 ..< 50 { tags := make([dynamic]Tag, 0, 3) - append(&tags, Tag{name = fmt.aprintf("%s-notes", year), slug = fmt.aprintf("%s-notes", year)}) + append( + &tags, + Tag{name = fmt.aprintf("%s-notes", year), slug = fmt.aprintf("%s-notes", year)}, + ) append(&tags, Tag{name = "writing", slug = "writing"}) append(&tags, Tag{name = "archive", slug = "archive"}) @@ -159,28 +174,34 @@ generate_data :: proc() -> Page_Data { author = fmt.aprintf("Author %d", i % 5) } - append(&posts, Post{ - title = fmt.aprintf("Post %d from %s", i, year), - url = fmt.aprintf("/%s/post-%d", year, i), - date = fmt.aprintf("%s-%02d-%02dT10:00:00Z", year, month, day), - year = year, - excerpt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", - author = author, - tags = tags, - }) + append( + &posts, + Post { + title = fmt.aprintf("Post %d from %s", i, year), + url = fmt.aprintf("/%s/post-%d", year, i), + date = fmt.aprintf("%s-%02d-%02dT10:00:00Z", year, month, day), + year = year, + excerpt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + author = author, + tags = tags, + }, + ) } } comments := make([dynamic]Comment, 0, 100) - for i in 0..<100 { + for i in 0 ..< 100 { year := years[i % len(years)] month := (i % 12) + 1 day := (i % 28) + 1 - append(&comments, Comment{ - author = fmt.aprintf("Commenter %d", i), - date = fmt.aprintf("%s-%02d-%02dT12:00:00Z", year, month, day), - body = fmt.aprintf("Great post! This is comment number %d.", i), - }) + append( + &comments, + Comment { + author = fmt.aprintf("Commenter %d", i), + date = fmt.aprintf("%s-%02d-%02dT12:00:00Z", year, month, day), + body = fmt.aprintf("Great post! This is comment number %d.", i), + }, + ) } nav_items := make([dynamic]Nav_Item, 0, 8) @@ -193,7 +214,7 @@ generate_data :: proc() -> Page_Data { append(&nav_items, Nav_Item{url = "https://twitter.com/example", label = "Twitter"}) append(&nav_items, Nav_Item{url = "mailto:nobody@example.com", label = "Email"}) - return Page_Data{ + return Page_Data { title = "Post Archive", now = "2025-07-21T12:00:00Z", posts = posts, diff --git a/bench/date/check.odin b/bench/date/check.odin index 8e825e9..881cf88 100644 --- a/bench/date/check.odin +++ b/bench/date/check.odin @@ -127,4 +127,3 @@ to_benchmark :: proc($f: formatter) -> benchmark { } \ ) } - diff --git a/bench/date/common/types.odin b/bench/date/common/types.odin index 46abd1f..6e735bd 100644 --- a/bench/date/common/types.odin +++ b/bench/date/common/types.odin @@ -41,4 +41,3 @@ parse_2_digits :: proc(s: string, offset: int) -> int { } return (int(s[offset]) - 0x30) * 10 + (int(s[offset + 1]) - 0x30) } - diff --git a/bench/date/inlined/format.odin b/bench/date/inlined/format.odin index 381cc1d..4dcb5ab 100644 --- a/bench/date/inlined/format.odin +++ b/bench/date/inlined/format.odin @@ -123,4 +123,3 @@ emit_hour_12 :: proc(b: ^strings.Builder, dt: common.Date_Components, pad: bool) fmt.sbprintf(b, format, h12) } - diff --git a/bench/date/inplace/format.odin b/bench/date/inplace/format.odin index 5297365..c5fd60a 100644 --- a/bench/date/inplace/format.odin +++ b/bench/date/inplace/format.odin @@ -130,4 +130,3 @@ emit_hour_12 :: proc(b: ^strings.Builder, dt: common.Date_Components, pad: bool) fmt.sbprintf(b, format, h12) } - diff --git a/bench/date/original/format.odin b/bench/date/original/format.odin index d9868dd..f03bf54 100644 --- a/bench/date/original/format.odin +++ b/bench/date/original/format.odin @@ -125,4 +125,3 @@ emit_am_pm :: proc(b: ^strings.Builder, dt: common.Date_Components) { emit_am_pm_lower :: proc(b: ^strings.Builder, dt: common.Date_Components) { strings.write_string(b, "pm" if dt.hour >= 12 else "am") } - diff --git a/bench/date/parse.odin b/bench/date/parse.odin index 43727f6..e77c034 100644 --- a/bench/date/parse.odin +++ b/bench/date/parse.odin @@ -41,4 +41,3 @@ parse_2_digits :: proc(s: string, offset: int) -> int { } return (int(s[offset]) - 0x30) * 10 + (int(s[offset + 1]) - 0x30) } - diff --git a/bench/date/returned/format.odin b/bench/date/returned/format.odin index 4442cc0..9c81da0 100644 --- a/bench/date/returned/format.odin +++ b/bench/date/returned/format.odin @@ -124,4 +124,3 @@ emit_hour_12 :: proc(b: ^strings.Builder, dt: common.Date_Components, pad: bool) fmt.sbprintf(b, format, h12) } - diff --git a/content.odin b/content.odin index 635ce18..5a3000b 100644 --- a/content.odin +++ b/content.odin @@ -238,9 +238,18 @@ load_page :: proc( if page.date == "" { info, stat_err := os.stat(file_path, context.allocator) if stat_err == nil { - page.date, _ = time.time_to_rfc3339(info.modification_time, 0, false, context.allocator) + page.date, _ = time.time_to_rfc3339( + info.modification_time, + 0, + false, + context.allocator, + ) os.file_info_delete(info, context.allocator) - log.warnf("no date in frontmatter for %s, using file modification time: %s", file_path, page.date) + log.warnf( + "no date in frontmatter for %s, using file modification time: %s", + file_path, + page.date, + ) } } page.year = get_year(page.date) @@ -282,4 +291,3 @@ strip_extension :: proc(name: string) -> string { } return name[:dot] } - diff --git a/defaults.odin b/defaults.odin index a88ff3b..757b79b 100644 --- a/defaults.odin +++ b/defaults.odin @@ -3,4 +3,3 @@ package main import "core:os" DEFAULTS_PATH :: #directory + os.Path_Separator_String + "defaults" - diff --git a/feed.odin b/feed.odin index 57e5b34..0dc4263 100644 --- a/feed.odin +++ b/feed.odin @@ -149,4 +149,3 @@ xml_escape :: proc(s: string) -> string { r, _ = strings.replace_all(r, ">", ">") return r } - diff --git a/frontmatter.odin b/frontmatter.odin index 1a5f4d8..1d629f7 100644 --- a/frontmatter.odin +++ b/frontmatter.odin @@ -48,10 +48,10 @@ parse_frontmatter :: proc(content: string) -> (fm: Frontmatter, body: string, ok return } - fm.title = json_get_string(obj, "title") + fm.title = json_get_string(obj, "title") fm.description = json_get_string(obj, "description") - fm.date = json_get_string(obj, "date") - fm.lastmod = json_get_string(obj, "lastmod") + fm.date = json_get_string(obj, "date") + fm.lastmod = json_get_string(obj, "lastmod") fm.publishDate = json_get_string(obj, "publishDate") fm.draft = json_get_bool(obj, "draft") fm.isStarred = json_get_bool(obj, "isStarred") @@ -85,18 +85,17 @@ json_get_open_graph :: proc(obj: json.Object, key: string) -> Open_Graph { og: Open_Graph if v, ok := obj[key]; ok { if inner, ok2 := v.(json.Object); ok2 { - og.title = json_get_string(inner, "title") - og.type = json_get_string(inner, "type") - og.image = json_get_string(inner, "image") - og.url = json_get_string(inner, "url") - og.description = json_get_string(inner, "description") - og.locale = json_get_string(inner, "locale") - og.site_name = json_get_string(inner, "site_name") + og.title = json_get_string(inner, "title") + og.type = json_get_string(inner, "type") + og.image = json_get_string(inner, "image") + og.url = json_get_string(inner, "url") + og.description = json_get_string(inner, "description") + og.locale = json_get_string(inner, "locale") + og.site_name = json_get_string(inner, "site_name") og.published_time = json_get_string(inner, "published_time") - og.modified_time = json_get_string(inner, "modified_time") - og.section = json_get_string(inner, "section") + og.modified_time = json_get_string(inner, "modified_time") + og.section = json_get_string(inner, "section") } } return og } - diff --git a/html_test.odin b/html_test.odin index 2a88e53..d8c30d0 100644 --- a/html_test.odin +++ b/html_test.odin @@ -82,9 +82,7 @@ test_description_plain_text :: proc(t: ^testing.T) { @(test) test_description_highlighted_code :: proc(t: ^testing.T) { - result := generate_description( - `
if x
`, - ) + result := generate_description(`
if x
`) testing.expect_value(t, result, "if x") } diff --git a/it/it.odin b/it/it.odin index c53ce09..d9a15f1 100644 --- a/it/it.odin +++ b/it/it.odin @@ -25,4 +25,3 @@ main :: proc() { fmt.printfln("%+v", site) fmt.printf("%+v", site) } - diff --git a/main.odin b/main.odin index 4ae3a27..26c03ce 100644 --- a/main.odin +++ b/main.odin @@ -94,4 +94,3 @@ when SPALL { spall._buffer_end(&spall_ctx, &spall_buffer) } } - diff --git a/main_test.odin b/main_test.odin index b1c93b1..4e6bf09 100644 --- a/main_test.odin +++ b/main_test.odin @@ -7,4 +7,3 @@ import "core:testing" test_true :: proc(t: ^testing.T) { testing.expect(t, true) } - diff --git a/markdown/alerts.odin b/markdown/alerts.odin index 928d995..52eabf3 100644 --- a/markdown/alerts.odin +++ b/markdown/alerts.odin @@ -95,4 +95,3 @@ transform_alert :: proc(sb: ^strings.Builder, bq: string) { strings.write_string(sb, " ") strings.write_string(sb, rest) } - diff --git a/markdown/alerts_test.odin b/markdown/alerts_test.odin index 11ff091..9114eac 100644 --- a/markdown/alerts_test.odin +++ b/markdown/alerts_test.odin @@ -101,4 +101,3 @@ test_multiple_alerts_render_together :: proc(t: ^testing.T) { `, ) } - diff --git a/markdown/emoji.odin b/markdown/emoji.odin index 41b7b26..6351f4c 100644 --- a/markdown/emoji.odin +++ b/markdown/emoji.odin @@ -434,4 +434,3 @@ expand_emoji :: proc(text: string) -> string { return strings.to_string(sb) } - diff --git a/markdown/emoji_test.odin b/markdown/emoji_test.odin index ac8f7a2..f231a04 100644 --- a/markdown/emoji_test.odin +++ b/markdown/emoji_test.odin @@ -30,4 +30,3 @@ test_emoji_skips_invalid_shortcodes :: proc(t: ^testing.T) { testing.expect_value(t, expand_emoji(":Smile:"), ":Smile:") testing.expect_value(t, expand_emoji(": not real :"), ": not real :") } - diff --git a/markdown/footnotes.odin b/markdown/footnotes.odin index 3248508..abbe190 100644 --- a/markdown/footnotes.odin +++ b/markdown/footnotes.odin @@ -210,4 +210,3 @@ strip_p_tags :: proc(html: string) -> string { } return s } - diff --git a/markdown/footnotes_test.odin b/markdown/footnotes_test.odin index a4775cb..0f84c25 100644 --- a/markdown/footnotes_test.odin +++ b/markdown/footnotes_test.odin @@ -119,4 +119,3 @@ test_inject_notes_missing_ref :: proc(t: ^testing.T) { testing.expect(t, strings.contains(out, "[^missing]")) testing.expect(t, strings.contains(out, "[*missing]")) } - diff --git a/markdown/heading_ids.odin b/markdown/heading_ids.odin index a19cb12..91ca85a 100644 --- a/markdown/heading_ids.odin +++ b/markdown/heading_ids.odin @@ -193,4 +193,3 @@ make_unique :: proc(slug: string, seen: ^map[string]bool) -> string { } return "" } - diff --git a/markdown/heading_ids_test.odin b/markdown/heading_ids_test.odin index 0f6c46b..86fef89 100644 --- a/markdown/heading_ids_test.odin +++ b/markdown/heading_ids_test.odin @@ -12,7 +12,11 @@ test_heading_simple :: proc(t: ^testing.T) { @(test) test_heading_dedup :: proc(t: ^testing.T) { result := inject_heading_ids("

Intro

text

Intro

") - testing.expect_value(t, result, `

Intro

text

Intro

`) + testing.expect_value( + t, + result, + `

Intro

text

Intro

`, + ) } @(test) @@ -36,7 +40,9 @@ test_heading_punctuation :: proc(t: ^testing.T) { @(test) test_heading_all_levels :: proc(t: ^testing.T) { result := inject_heading_ids("

A

B

C

D

E
F
") - testing.expect_value(t, result, + testing.expect_value( + t, + result, `

A

` + `

B

` + `

C

` + @@ -88,9 +94,9 @@ test_heading_numbers :: proc(t: ^testing.T) { @(test) test_heading_triple_dedup :: proc(t: ^testing.T) { result := inject_heading_ids("

Foo

Foo

Foo

") - testing.expect_value(t, result, - `

Foo

` + - `

Foo

` + - `

Foo

`, + testing.expect_value( + t, + result, + `

Foo

` + `

Foo

` + `

Foo

`, ) } diff --git a/markdown/highlight.odin b/markdown/highlight.odin index 6e60a56..e84bafe 100644 --- a/markdown/highlight.odin +++ b/markdown/highlight.odin @@ -305,4 +305,3 @@ highlight_code :: proc(html: string, file_path: string) -> string { } return strings.to_string(sb) } - diff --git a/markdown/markdown.odin b/markdown/markdown.odin index 1cb6887..1751dc5 100644 --- a/markdown/markdown.odin +++ b/markdown/markdown.odin @@ -88,4 +88,3 @@ apply_extension_config :: proc(ext: ^bit_set[Extension], config: json.Object) { } } } - diff --git a/markdown/sectionate.odin b/markdown/sectionate.odin index 581ada7..58b9fb3 100644 --- a/markdown/sectionate.odin +++ b/markdown/sectionate.odin @@ -43,4 +43,3 @@ wrap_sections :: proc(html: string) -> string { return html } } - diff --git a/markdown/sectionate_test.odin b/markdown/sectionate_test.odin index 5e410f9..21d2029 100644 --- a/markdown/sectionate_test.odin +++ b/markdown/sectionate_test.odin @@ -46,4 +46,3 @@ test_wrap_sections_doesnt_split_content :: proc(t: ^testing.T) { "

Big

Small

", ) } - diff --git a/menus.odin b/menus.odin index 6356797..dc392e8 100644 --- a/menus.odin +++ b/menus.odin @@ -221,4 +221,3 @@ parse_config_menus :: proc( return result } - diff --git a/minify.odin b/minify.odin index 33e7a2f..855e1c5 100644 --- a/minify.odin +++ b/minify.odin @@ -54,7 +54,7 @@ minify_html :: proc(source: string) -> string { segment := source[i:p.end] strings.write_string(&sb, segment) if len(segment) > 0 { - last_written = segment[len(segment)-1] + last_written = segment[len(segment) - 1] } i = int(p.end) pi += 1 @@ -103,27 +103,27 @@ collect_html_ranges :: proc( preserves: ^[dynamic]Range, ) { child_count := ts.node_named_child_count(node) - for i in 0.. string { child_count := ts.node_named_child_count(element) - for i in 0.. string { collect_css_comments :: proc(node: ts.Node, comments: ^[dynamic]Range) { child_count := ts.node_named_child_count(node) - for i in 0.. (tokens: [dynamic]string, err: } if j >= len(seg) { return tokens, Error_Body { - msg = fmt.tprintf("unterminated string literal: %s", seg), - pos = pos, + msg = fmt.tprintf("unterminated string literal: %s", seg), + pos = pos, kind = .Syntax, } } @@ -177,16 +177,16 @@ resolve_format_string :: proc(name: string, ctx: []any, pos: int) -> (string, Er raw := resolve_name(name, ctx) if raw == nil { return "", Error_Body { - msg = fmt.tprintf("unable to resolve date format key '%s'", name), - pos = pos, + msg = fmt.tprintf("unable to resolve date format key '%s'", name), + pos = pos, kind = .Data, } } str, ok := reflect.as_string(raw) if !ok { return "", Error_Body { - msg = fmt.tprintf("date format key '%s' is not a string", name), - pos = pos, + msg = fmt.tprintf("date format key '%s' is not a string", name), + pos = pos, kind = .Data, } } @@ -337,4 +337,3 @@ apply_group_by :: proc(value: any, args: []string, pos: int) -> (result: any, er return groups, nil } - diff --git a/mustache/pipes_test.odin b/mustache/pipes_test.odin index 54c193f..c45238c 100644 --- a/mustache/pipes_test.odin +++ b/mustache/pipes_test.odin @@ -214,7 +214,7 @@ test_interp_pipe_basic :: proc(t: ^testing.T) { timezone: ^datetime.TZ_Region, } data := Scalar_Data { - name = "2026-03-15T08:49:54-04:00", + name = "2026-03-15T08:49:54-04:00", date_format = "2 Jan 2006", } tpl, _ := parse("[{{name | format}}]", "", allocator = context.temp_allocator) @@ -230,7 +230,7 @@ test_interp_pipe_unescaped :: proc(t: ^testing.T) { timezone: ^datetime.TZ_Region, } data := Scalar_Data { - name = "2025-12-25T00:00:00Z", + name = "2025-12-25T00:00:00Z", date_format = "2 Jan 2006", } tpl, _ := parse("[{{&name | format}}]", "", allocator = context.temp_allocator) @@ -246,10 +246,14 @@ test_interp_pipe_dot_current :: proc(t: ^testing.T) { timezone: ^datetime.TZ_Region, } data := List_Data { - items = {"2026-01-06T00:00:00Z", "2026-06-15T00:00:00Z", "2026-10-15T00:00:00Z"}, + items = {"2026-01-06T00:00:00Z", "2026-06-15T00:00:00Z", "2026-10-15T00:00:00Z"}, date_format = "2 Jan 2006", } - tpl, _ := parse("{{#items}}[{{. | format}}]{{/items}}", "", allocator = context.temp_allocator) + tpl, _ := parse( + "{{#items}}[{{. | format}}]{{/items}}", + "", + allocator = context.temp_allocator, + ) result, _ := render(tpl, data, {}, context.temp_allocator) testing.expect_value(t, result, "[6 Jan 2026][15 Jun 2026][15 Oct 2026]") } @@ -267,7 +271,7 @@ Format_Data :: struct { @(test) test_format_typical_iso :: proc(t: ^testing.T) { data := Format_Data { - date = "2026-03-15T08:49:54-04:00", + date = "2026-03-15T08:49:54-04:00", date_format = "2 Jan 2006", } tpl, _ := parse("{{date | format}}", "", allocator = context.temp_allocator) @@ -278,7 +282,7 @@ test_format_typical_iso :: proc(t: ^testing.T) { @(test) test_format_short_date_only :: proc(t: ^testing.T) { data := Format_Data { - date = "2026-06-06", + date = "2026-06-06", date_format = "2 Jan 2006", } tpl, _ := parse("{{date | format}}", "", allocator = context.temp_allocator) @@ -289,7 +293,7 @@ test_format_short_date_only :: proc(t: ^testing.T) { @(test) test_format_empty_input_errors :: proc(t: ^testing.T) { data := Format_Data { - date = "", + date = "", date_format = "2 Jan 2006", } tpl, _ := parse("[{{date | format}}]", "", allocator = context.temp_allocator) @@ -301,7 +305,7 @@ test_format_empty_input_errors :: proc(t: ^testing.T) { @(test) test_format_non_date_string_errors :: proc(t: ^testing.T) { data := Format_Data { - date = "abc", + date = "abc", date_format = "2 Jan 2006", } tpl, _ := parse("[{{date | format}}]", "", allocator = context.temp_allocator) @@ -327,7 +331,7 @@ test_format_non_string_value_errors :: proc(t: ^testing.T) { @(test) test_format_invalid_month_errors :: proc(t: ^testing.T) { data := Format_Data { - date = "2023-13-15", + date = "2023-13-15", date_format = "2 Jan 2006", } tpl, _ := parse("{{date | format}}", "", allocator = context.temp_allocator) @@ -341,7 +345,7 @@ test_format_inside_section_renders :: proc(t: ^testing.T) { // Mirrors the datetime.html partial pattern: section pushes raw string, // partial uses {{.}} for ISO attr and {{. | format}} for display. data := Format_Data { - date = "2025-12-25T00:00:00Z", + date = "2025-12-25T00:00:00Z", date_format = "2 Jan 2006", } tpl, _ := parse( @@ -356,10 +360,14 @@ test_format_inside_section_renders :: proc(t: ^testing.T) { @(test) test_format_inside_section_skips_when_empty :: proc(t: ^testing.T) { data := Format_Data { - date = "", + date = "", date_format = "2 Jan 2006", } - tpl, _ := parse("[{{#date}}{{/date}}]", "", allocator = context.temp_allocator) + tpl, _ := parse( + "[{{#date}}{{/date}}]", + "", + allocator = context.temp_allocator, + ) result, _ := render(tpl, data, {}, context.temp_allocator) testing.expect_value(t, result, "[]") } @@ -374,7 +382,11 @@ test_format_quoted_literal_arg :: proc(t: ^testing.T) { date = "2026-03-15T08:49:54-04:00", date_format = "2 Jan 2006", } - tpl, _ := parse(`{{date | format "Jan 2, 2006"}}`, "", allocator = context.temp_allocator) + tpl, _ := parse( + `{{date | format "Jan 2, 2006"}}`, + "", + allocator = context.temp_allocator, + ) result, _ := render(tpl, data, {}, context.temp_allocator) testing.expect_value(t, result, "Mar 15, 2026") } @@ -465,7 +477,7 @@ test_format_handles_all_iso8601_variants :: proc(t: ^testing.T) { } for &c in cases { data := Format_Data { - date = c.input, + date = c.input, date_format = "2 Jan 2006", } tpl, _ := parse("{{date | format}}", "", allocator = context.temp_allocator) diff --git a/mustache/spec_test.odin b/mustache/spec_test.odin index 6cc8655..56926c2 100644 --- a/mustache/spec_test.odin +++ b/mustache/spec_test.odin @@ -132,4 +132,3 @@ spec_dynamic_names :: proc(t: ^testing.T) { spec_inheritance :: proc(t: ^testing.T) { run_spec_file(t, "spec/specs/~inheritance.json") } - diff --git a/mustache/suggest.odin b/mustache/suggest.odin index ec4fe16..f4023ab 100644 --- a/mustache/suggest.odin +++ b/mustache/suggest.odin @@ -184,10 +184,7 @@ collect_partial_names :: proc( // collect_block_names enumerates the unique `{{$name}}` block definitions in // a template's node array. -collect_block_names :: proc( - tmpl: Template, - allocator := context.temp_allocator, -) -> []string { +collect_block_names :: proc(tmpl: Template, allocator := context.temp_allocator) -> []string { out := make([dynamic]string, 0, 0, allocator) seen := make(map[string]bool, allocator) defer delete(seen) diff --git a/mustache/suggest_test.odin b/mustache/suggest_test.odin index 9f90f27..95b5dc5 100644 --- a/mustache/suggest_test.odin +++ b/mustache/suggest_test.odin @@ -196,4 +196,3 @@ test_warn_no_false_positive_for_valid_keys :: proc(t: ^testing.T) { ok, missing, _ := validate_key_path(ctx[:], "name") testing.expect_value(t, ok, true) } - diff --git a/mustache/tokenizer.odin b/mustache/tokenizer.odin index 59a43bf..97625b9 100644 --- a/mustache/tokenizer.odin +++ b/mustache/tokenizer.odin @@ -104,11 +104,7 @@ tokenize :: proc( close_idx := strings.index(src[key_start:], "}}") if close_idx < 0 { - return tokens, Error_Body { - msg = "unclosed tag '{{'", - pos = tag_pos, - kind = .Syntax, - } + return tokens, Error_Body{msg = "unclosed tag '{{'", pos = tag_pos, kind = .Syntax} } close := key_start + close_idx @@ -125,12 +121,7 @@ tokenize :: proc( } append( &tokens, - Token { - kind = .Partial, - value = trimmed, - is_dynamic = is_dyn, - pos = tag_pos, - }, + Token{kind = .Partial, value = trimmed, is_dynamic = is_dyn, pos = tag_pos}, ) } else { append( @@ -299,4 +290,3 @@ should_trim_whitespace :: proc(kind: Token_Kind) -> bool { } return false } - diff --git a/opengraph.odin b/opengraph.odin index 8186f23..ca30a97 100644 --- a/opengraph.odin +++ b/opengraph.odin @@ -115,4 +115,3 @@ og_for_page :: proc(site_og: Open_Graph, page: Page) -> Open_Graph { return og } - diff --git a/render.odin b/render.odin index 55ab5df..0a96e01 100644 --- a/render.odin +++ b/render.odin @@ -404,4 +404,3 @@ write_file :: proc(path: string, html: string) { log.errorf("cannot write %s: %v", path, err) } } - diff --git a/site.odin b/site.odin index 7055232..60ea779 100644 --- a/site.odin +++ b/site.odin @@ -273,4 +273,3 @@ find_config :: proc(filename: string) -> (path: string, ok: bool) { dir = dir[:idx] } } - diff --git a/site_test.odin b/site_test.odin index cc21fdf..9514d14 100644 --- a/site_test.odin +++ b/site_test.odin @@ -181,12 +181,15 @@ test_init_site_md_enable_disable :: proc(t: ^testing.T) { @(test) test_init_site_config_paths :: proc(t: ^testing.T) { - path := write_temp_config("paths", `{ + path := write_temp_config( + "paths", + `{ "content_dir": "/custom/content", "assets_dir": "/custom/assets", "output_dir": "/custom/output", "layouts_dir": "/custom/layouts" - }`) + }`, + ) defer os.remove(path) site: Site @@ -199,4 +202,3 @@ test_init_site_config_paths :: proc(t: ^testing.T) { testing.expect_value(t, site.output_dir, "/custom/output") testing.expect_value(t, site.layouts_dir, "/custom/layouts") } - diff --git a/treesitter/treesitter.odin b/treesitter/treesitter.odin index 95a6d8a..3522f15 100644 --- a/treesitter/treesitter.odin +++ b/treesitter/treesitter.odin @@ -146,7 +146,7 @@ init_persistent :: proc() { } when SPALL { - _thread_init: proc() = nil + _thread_init: proc() = nil _thread_cleanup: proc() = nil set_thread_callbacks :: proc(init: proc() = nil, cleanup: proc() = nil) { @@ -249,7 +249,14 @@ ensure_parser :: proc(lang: string) -> ^Grammar_Cache { return gc } -compile_query :: proc(lang: string, language: Language) -> (query: Query, cursor: Query_Cursor, ok: bool) { +compile_query :: proc( + lang: string, + language: Language, +) -> ( + query: Query, + cursor: Query_Cursor, + ok: bool, +) { query_src, query_path, qok := load_query(lang) if !qok { return @@ -451,4 +458,3 @@ helix_version_from_path :: proc(path: string) -> string { if end <= start do return "" return path[start:end] } - diff --git a/vfs.odin b/vfs.odin index e565b46..3a96bb0 100644 --- a/vfs.odin +++ b/vfs.odin @@ -109,4 +109,3 @@ vfs_entry_data :: proc(entry: VFS_Entry) -> ([]byte, bool) { } return data, true } -