diff --git a/cmd/lx/golden_test.go b/cmd/lx/golden_test.go index eed79db..57fd27f 100644 --- a/cmd/lx/golden_test.go +++ b/cmd/lx/golden_test.go @@ -149,6 +149,7 @@ func TestGolden(t *testing.T) { }}, {name: "101_stdin_null_terminated", args: []string{"-0"}, stdin: "main.go\x00README.md\x00spaces/file with spaces.txt\x00"}, {name: "102_walk_nested_respects_root_ignore", args: []string{"parent_ignore_test/level1/level2"}}, + {name: "103_complex_ignore_exceptions", args: []string{"ignore_exception_test"}}, } runGoldenTests(t, cases, pkgDir, workDir, canonicalWorkDir) @@ -446,6 +447,26 @@ func setupComplexFixture(t *testing.T) string { create("parent_ignore_test/level1/level2/ignore_me.tmp", "ignore", 0644) create("parent_ignore_test/level1/level2/keep_me.go", "package level2", 0644) + // --- Complex Ignore Exceptions Test --- + ignoreContent := "*\n!/src/**\n!/migrations/**\n!/assets/**\n!/data/**/*.data.xlsx\n!/data/**/index.json\n!langgraph.json\n!pyproject.toml\n!uv.lock\n" + create("ignore_exception_test/.gitignore", ignoreContent, 0644) + + // Files that SHOULD BE KEPT (un-ignored) + create("ignore_exception_test/src/main.go", "package main", 0644) + create("ignore_exception_test/migrations/001_init.sql", "SELECT 1;", 0644) + create("ignore_exception_test/assets/logo.png", "image_data", 0644) + create("ignore_exception_test/data/nested/deep/my.data.xlsx", "excel_data", 0644) + create("ignore_exception_test/data/index.json", "{}", 0644) + create("ignore_exception_test/langgraph.json", "{}", 0644) + create("ignore_exception_test/pyproject.toml", "[tool]", 0644) + create("ignore_exception_test/uv.lock", "lock_data", 0644) + + // Files that SHOULD BE IGNORED + create("ignore_exception_test/should_ignore.txt", "ignore me", 0644) + create("ignore_exception_test/data/secret.csv", "1,2,3", 0644) + create("ignore_exception_test/data/nested/deep/ignore.xlsx", "ignore", 0644) + create("ignore_exception_test/other_dir/file.go", "package other", 0644) + // Image test asset create("assets/logo.png", "\x89PNG\r\n\x1a\n\x00\x00\x00\x0D", 0644) diff --git a/cmd/lx/testdata/golden/001_walk_default.golden b/cmd/lx/testdata/golden/001_walk_default.golden index 0445a1b..cae6ec4 100644 --- a/cmd/lx/testdata/golden/001_walk_default.golden +++ b/cmd/lx/testdata/golden/001_walk_default.golden @@ -1,132 +1,176 @@ --- STDOUT --- -[1/24] README.md (2 rows) +[1/32] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/24] assets/logo.png - binary file skipped (12 B) +[2/32] assets/logo.png - binary file skipped (12 B) -[3/24] configs/custom_sections.yaml (1 rows) +[3/32] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[4/24] configs/custom_template.yaml (1 rows) +[4/32] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[5/24] configs/follow.yaml (1 rows) +[5/32] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[6/24] configs/hidden.yaml (1 rows) +[6/32] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[7/24] configs/no_links.yaml (1 rows) +[7/32] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[8/24] doc/notes.txt (1 rows) +[8/32] doc/notes.txt (1 rows) --- ```text some notes ``` -[9/24] ignore_test/foo.go (1 rows) +[9/32] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[10/32] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[11/32] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[12/32] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[13/32] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[14/32] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[15/32] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[16/32] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[17/32] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[10/24] langs/Dockerfile (1 rows) +[18/32] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[11/24] langs/main.rs (1 rows) +[19/32] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[12/24] langs/script_no_ext (2 rows) +[20/32] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[13/24] links/cycle_a/visible.txt (1 rows) +[21/32] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[14/24] links/cycle_b/visible.txt (1 rows) +[22/32] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[15/24] links/link_to_main.go (~1 rows) +[23/32] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[16/24] links/safe_target/recursion.txt (1 rows) +[24/32] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[17/24] main.go (2 rows) +[25/32] main.go (2 rows) --- ```go package main func main() {} ``` -[18/24] main_test.go (2 rows) +[26/32] main_test.go (2 rows) --- ```go package main import "testing" ``` -[19/24] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[27/32] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[20/24] pkg/util.go (1 rows) +[28/32] pkg/util.go (1 rows) --- ```go package pkg ``` -[21/24] spaces/file with spaces.txt (1 rows) +[29/32] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[22/24] src/large.txt (100 rows) +[30/32] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -231,13 +275,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[23/24] src/script.py (1 rows) +[31/32] src/script.py (1 rows) --- ```python print('hello') ``` -[24/24] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[32/32] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/002_walk_compact.golden b/cmd/lx/testdata/golden/002_walk_compact.golden index 6c7610a..eebc607 100644 --- a/cmd/lx/testdata/golden/002_walk_compact.golden +++ b/cmd/lx/testdata/golden/002_walk_compact.golden @@ -1,29 +1,37 @@ --- STDOUT --- -[1/24] README.md (2 rows) -[2/24] assets/logo.png - binary file skipped (12 B) -[3/24] configs/custom_sections.yaml (1 rows) -[4/24] configs/custom_template.yaml (1 rows) -[5/24] configs/follow.yaml (1 rows) -[6/24] configs/hidden.yaml (1 rows) -[7/24] configs/no_links.yaml (1 rows) -[8/24] doc/notes.txt (1 rows) -[9/24] ignore_test/foo.go (1 rows) -[10/24] langs/Dockerfile (1 rows) -[11/24] langs/main.rs (1 rows) -[12/24] langs/script_no_ext (2 rows) -[13/24] links/cycle_a/visible.txt (1 rows) -[14/24] links/cycle_b/visible.txt (1 rows) -[15/24] links/link_to_main.go (~1 rows) -[16/24] links/safe_target/recursion.txt (1 rows) -[17/24] main.go (2 rows) -[18/24] main_test.go (2 rows) -[19/24] parent_ignore_test/level1/level2/keep_me.go (1 rows) -[20/24] pkg/util.go (1 rows) -[21/24] spaces/file with spaces.txt (1 rows) -[22/24] src/large.txt (100 rows) -[23/24] src/script.py (1 rows) +[1/32] README.md (2 rows) +[2/32] assets/logo.png - binary file skipped (12 B) +[3/32] configs/custom_sections.yaml (1 rows) +[4/32] configs/custom_template.yaml (1 rows) +[5/32] configs/follow.yaml (1 rows) +[6/32] configs/hidden.yaml (1 rows) +[7/32] configs/no_links.yaml (1 rows) +[8/32] doc/notes.txt (1 rows) +[9/32] ignore_exception_test/assets/logo.png - binary file skipped (10 B) +[10/32] ignore_exception_test/data/index.json (1 rows) +[11/32] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +[12/32] ignore_exception_test/langgraph.json (1 rows) +[13/32] ignore_exception_test/migrations/001_init.sql (1 rows) +[14/32] ignore_exception_test/pyproject.toml (1 rows) +[15/32] ignore_exception_test/src/main.go (1 rows) +[16/32] ignore_exception_test/uv.lock (1 rows) +[17/32] ignore_test/foo.go (1 rows) +[18/32] langs/Dockerfile (1 rows) +[19/32] langs/main.rs (1 rows) +[20/32] langs/script_no_ext (2 rows) +[21/32] links/cycle_a/visible.txt (1 rows) +[22/32] links/cycle_b/visible.txt (1 rows) +[23/32] links/link_to_main.go (~1 rows) +[24/32] links/safe_target/recursion.txt (1 rows) +[25/32] main.go (2 rows) +[26/32] main_test.go (2 rows) +[27/32] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[28/32] pkg/util.go (1 rows) +[29/32] spaces/file with spaces.txt (1 rows) +[30/32] src/large.txt (100 rows) +[31/32] src/script.py (1 rows) -[24/24] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[32/32] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/010_fmt_xml.golden b/cmd/lx/testdata/golden/010_fmt_xml.golden index 666fb68..c2fe990 100644 --- a/cmd/lx/testdata/golden/010_fmt_xml.golden +++ b/cmd/lx/testdata/golden/010_fmt_xml.golden @@ -55,28 +55,82 @@ some notes - + + ignore_exception_test/assets/logo.png + Binary file (10 B) + + + + ignore_exception_test/data/index.json + +{} + + + + + ignore_exception_test/data/nested/deep/my.data.xlsx + +excel_data + + + + + ignore_exception_test/langgraph.json + +{} + + + + + ignore_exception_test/migrations/001_init.sql + +SELECT 1; + + + + + ignore_exception_test/pyproject.toml + +[tool] + + + + + ignore_exception_test/src/main.go + +package main + + + + + ignore_exception_test/uv.lock + +lock_data + + + + ignore_test/foo.go package foo - + langs/Dockerfile FROM scratch - + langs/main.rs fn main() {} - + langs/script_no_ext #!/bin/bash @@ -84,21 +138,21 @@ echo hi - + links/cycle_a/visible.txt a - + links/cycle_b/visible.txt b - + links/link_to_main.go package main @@ -106,14 +160,14 @@ func main() {} - + links/safe_target/recursion.txt I am safe - + main.go package main @@ -121,7 +175,7 @@ func main() {} - + main_test.go package main @@ -129,28 +183,28 @@ import "testing" - + parent_ignore_test/level1/level2/keep_me.go package level2 - + pkg/util.go package pkg - + spaces/file with spaces.txt content with spaces - + src/large.txt Line xxxxxxxxxx @@ -256,14 +310,14 @@ Line xxxxxxxxxx - + src/script.py print('hello') - + /ROOT/content/links/broken_link open /ROOT/content/links/broken_link: FILE_NOT_FOUND diff --git a/cmd/lx/testdata/golden/030_include_only_go.golden b/cmd/lx/testdata/golden/030_include_only_go.golden index fede645..97c9611 100644 --- a/cmd/lx/testdata/golden/030_include_only_go.golden +++ b/cmd/lx/testdata/golden/030_include_only_go.golden @@ -1,38 +1,44 @@ --- STDOUT --- -[1/6] ignore_test/foo.go (1 rows) +[1/7] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[2/7] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[2/6] links/link_to_main.go (~1 rows) +[3/7] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[3/6] main.go (2 rows) +[4/7] main.go (2 rows) --- ```go package main func main() {} ``` -[4/6] main_test.go (2 rows) +[5/7] main_test.go (2 rows) --- ```go package main import "testing" ``` -[5/6] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[6/7] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[6/6] pkg/util.go (1 rows) +[7/7] pkg/util.go (1 rows) --- ```go package pkg diff --git a/cmd/lx/testdata/golden/031_exclude_tests.golden b/cmd/lx/testdata/golden/031_exclude_tests.golden index 2d956d7..46f8c79 100644 --- a/cmd/lx/testdata/golden/031_exclude_tests.golden +++ b/cmd/lx/testdata/golden/031_exclude_tests.golden @@ -1,125 +1,169 @@ --- STDOUT --- -[1/23] README.md (2 rows) +[1/31] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/23] assets/logo.png - binary file skipped (12 B) +[2/31] assets/logo.png - binary file skipped (12 B) -[3/23] configs/custom_sections.yaml (1 rows) +[3/31] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[4/23] configs/custom_template.yaml (1 rows) +[4/31] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[5/23] configs/follow.yaml (1 rows) +[5/31] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[6/23] configs/hidden.yaml (1 rows) +[6/31] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[7/23] configs/no_links.yaml (1 rows) +[7/31] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[8/23] doc/notes.txt (1 rows) +[8/31] doc/notes.txt (1 rows) --- ```text some notes ``` -[9/23] ignore_test/foo.go (1 rows) +[9/31] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[10/31] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[11/31] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[12/31] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[13/31] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[14/31] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[15/31] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[16/31] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[17/31] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[10/23] langs/Dockerfile (1 rows) +[18/31] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[11/23] langs/main.rs (1 rows) +[19/31] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[12/23] langs/script_no_ext (2 rows) +[20/31] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[13/23] links/cycle_a/visible.txt (1 rows) +[21/31] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[14/23] links/cycle_b/visible.txt (1 rows) +[22/31] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[15/23] links/link_to_main.go (~1 rows) +[23/31] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[16/23] links/safe_target/recursion.txt (1 rows) +[24/31] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[17/23] main.go (2 rows) +[25/31] main.go (2 rows) --- ```go package main func main() {} ``` -[18/23] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[26/31] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[19/23] pkg/util.go (1 rows) +[27/31] pkg/util.go (1 rows) --- ```go package pkg ``` -[20/23] spaces/file with spaces.txt (1 rows) +[28/31] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[21/23] src/large.txt (100 rows) +[29/31] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -224,13 +268,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[22/23] src/script.py (1 rows) +[30/31] src/script.py (1 rows) --- ```python print('hello') ``` -[23/23] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[31/31] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/032_mixed_filters.golden b/cmd/lx/testdata/golden/032_mixed_filters.golden index aab2ca1..24efaad 100644 --- a/cmd/lx/testdata/golden/032_mixed_filters.golden +++ b/cmd/lx/testdata/golden/032_mixed_filters.golden @@ -1,31 +1,37 @@ --- STDOUT --- -[1/5] ignore_test/foo.go (1 rows) +[1/6] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[2/6] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[2/5] links/link_to_main.go (~1 rows) +[3/6] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[3/5] main.go (2 rows) +[4/6] main.go (2 rows) --- ```go package main func main() {} ``` -[4/5] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[5/6] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[5/5] pkg/util.go (1 rows) +[6/6] pkg/util.go (1 rows) --- ```go package pkg diff --git a/cmd/lx/testdata/golden/033_filter_reset.golden b/cmd/lx/testdata/golden/033_filter_reset.golden index cd4585a..c3284c0 100644 --- a/cmd/lx/testdata/golden/033_filter_reset.golden +++ b/cmd/lx/testdata/golden/033_filter_reset.golden @@ -9,134 +9,178 @@ Documentation here. ## All --- -[1/24] README.md (2 rows) +[1/32] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/24] assets/logo.png - binary file skipped (12 B) +[2/32] assets/logo.png - binary file skipped (12 B) -[3/24] configs/custom_sections.yaml (1 rows) +[3/32] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[4/24] configs/custom_template.yaml (1 rows) +[4/32] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[5/24] configs/follow.yaml (1 rows) +[5/32] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[6/24] configs/hidden.yaml (1 rows) +[6/32] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[7/24] configs/no_links.yaml (1 rows) +[7/32] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[8/24] doc/notes.txt (1 rows) +[8/32] doc/notes.txt (1 rows) --- ```text some notes ``` -[9/24] ignore_test/foo.go (1 rows) +[9/32] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[10/32] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[11/32] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[12/32] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[13/32] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[14/32] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[15/32] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[16/32] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[17/32] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[10/24] langs/Dockerfile (1 rows) +[18/32] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[11/24] langs/main.rs (1 rows) +[19/32] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[12/24] langs/script_no_ext (2 rows) +[20/32] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[13/24] links/cycle_a/visible.txt (1 rows) +[21/32] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[14/24] links/cycle_b/visible.txt (1 rows) +[22/32] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[15/24] links/link_to_main.go (~1 rows) +[23/32] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[16/24] links/safe_target/recursion.txt (1 rows) +[24/32] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[17/24] main.go (2 rows) +[25/32] main.go (2 rows) --- ```go package main func main() {} ``` -[18/24] main_test.go (2 rows) +[26/32] main_test.go (2 rows) --- ```go package main import "testing" ``` -[19/24] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[27/32] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[20/24] pkg/util.go (1 rows) +[28/32] pkg/util.go (1 rows) --- ```go package pkg ``` -[21/24] spaces/file with spaces.txt (1 rows) +[29/32] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[22/24] src/large.txt (100 rows) +[30/32] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -241,13 +285,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[23/24] src/script.py (1 rows) +[31/32] src/script.py (1 rows) --- ```python print('hello') ``` -[24/24] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[32/32] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/034_hidden_files.golden b/cmd/lx/testdata/golden/034_hidden_files.golden index e33a88d..e05571d 100644 --- a/cmd/lx/testdata/golden/034_hidden_files.golden +++ b/cmd/lx/testdata/golden/034_hidden_files.golden @@ -1,5 +1,5 @@ --- STDOUT --- -[1/27] .gitignore (3 rows) +[1/35] .gitignore (3 rows) --- ```gitignore bin/ @@ -7,146 +7,190 @@ secret/ *.tmp ``` -[2/27] .hidden (1 rows) +[2/35] .hidden (1 rows) --- ``` i am hidden ``` -[3/27] README.md (2 rows) +[3/35] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[4/27] assets/logo.png - binary file skipped (12 B) +[4/35] assets/logo.png - binary file skipped (12 B) -[5/27] configs/custom_sections.yaml (1 rows) +[5/35] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[6/27] configs/custom_template.yaml (1 rows) +[6/35] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[7/27] configs/follow.yaml (1 rows) +[7/35] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[8/27] configs/hidden.yaml (1 rows) +[8/35] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[9/27] configs/no_links.yaml (1 rows) +[9/35] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[10/27] doc/notes.txt (1 rows) +[10/35] doc/notes.txt (1 rows) --- ```text some notes ``` -[11/27] ignore_test/.gitignore (1 rows) +[11/35] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[12/35] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[13/35] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[14/35] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[15/35] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[16/35] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[17/35] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[18/35] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[19/35] ignore_test/.gitignore (1 rows) --- ```gitignore bar.go ``` -[12/27] ignore_test/foo.go (1 rows) +[20/35] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[13/27] langs/Dockerfile (1 rows) +[21/35] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[14/27] langs/main.rs (1 rows) +[22/35] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[15/27] langs/script_no_ext (2 rows) +[23/35] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[16/27] links/cycle_a/visible.txt (1 rows) +[24/35] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[17/27] links/cycle_b/visible.txt (1 rows) +[25/35] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[18/27] links/link_to_main.go (~1 rows) +[26/35] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[19/27] links/safe_target/recursion.txt (1 rows) +[27/35] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[20/27] main.go (2 rows) +[28/35] main.go (2 rows) --- ```go package main func main() {} ``` -[21/27] main_test.go (2 rows) +[29/35] main_test.go (2 rows) --- ```go package main import "testing" ``` -[22/27] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[30/35] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[23/27] pkg/util.go (1 rows) +[31/35] pkg/util.go (1 rows) --- ```go package pkg ``` -[24/27] spaces/file with spaces.txt (1 rows) +[32/35] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[25/27] src/large.txt (100 rows) +[33/35] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -251,13 +295,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[26/27] src/script.py (1 rows) +[34/35] src/script.py (1 rows) --- ```python print('hello') ``` -[27/27] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[35/35] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/035_no_ignore_files.golden b/cmd/lx/testdata/golden/035_no_ignore_files.golden index 391c55d..0b73a3c 100644 --- a/cmd/lx/testdata/golden/035_no_ignore_files.golden +++ b/cmd/lx/testdata/golden/035_no_ignore_files.golden @@ -1,148 +1,216 @@ --- STDOUT --- -[1/29] README.md (2 rows) +[1/41] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/29] assets/logo.png - binary file skipped (12 B) -[3/29] bin/data.bin - binary file skipped (4 B) -[4/29] bin/empty.txt (0 rows) +[2/41] assets/logo.png - binary file skipped (12 B) +[3/41] bin/data.bin - binary file skipped (4 B) +[4/41] bin/empty.txt (0 rows) -[5/29] configs/custom_sections.yaml (1 rows) +[5/41] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[6/29] configs/custom_template.yaml (1 rows) +[6/41] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[7/29] configs/follow.yaml (1 rows) +[7/41] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[8/29] configs/hidden.yaml (1 rows) +[8/41] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[9/29] configs/no_links.yaml (1 rows) +[9/41] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[10/29] doc/notes.txt (1 rows) +[10/41] doc/notes.txt (1 rows) --- ```text some notes ``` -[11/29] ignore_test/bar.go (1 rows) +[11/41] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[12/41] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[13/41] ignore_exception_test/data/nested/deep/ignore.xlsx (1 rows) +--- +``` +ignore +``` + +[14/41] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[15/41] ignore_exception_test/data/secret.csv (1 rows) +--- +```csv +1,2,3 +``` + +[16/41] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[17/41] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[18/41] ignore_exception_test/other_dir/file.go (1 rows) +--- +```go +package other +``` + +[19/41] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[20/41] ignore_exception_test/should_ignore.txt (1 rows) +--- +```text +ignore me +``` + +[21/41] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[22/41] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[23/41] ignore_test/bar.go (1 rows) --- ```go package bar ``` -[12/29] ignore_test/foo.go (1 rows) +[24/41] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[13/29] langs/Dockerfile (1 rows) +[25/41] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[14/29] langs/main.rs (1 rows) +[26/41] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[15/29] langs/script_no_ext (2 rows) +[27/41] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[16/29] links/cycle_a/visible.txt (1 rows) +[28/41] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[17/29] links/cycle_b/visible.txt (1 rows) +[29/41] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[18/29] links/link_to_main.go (~1 rows) +[30/41] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[19/29] links/safe_target/recursion.txt (1 rows) +[31/41] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[20/29] main.go (2 rows) +[32/41] main.go (2 rows) --- ```go package main func main() {} ``` -[21/29] main_test.go (2 rows) +[33/41] main_test.go (2 rows) --- ```go package main import "testing" ``` -[22/29] parent_ignore_test/level1/level2/ignore_me.tmp (1 rows) +[34/41] parent_ignore_test/level1/level2/ignore_me.tmp (1 rows) --- ``` ignore ``` -[23/29] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[35/41] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[24/29] pkg/util.go (1 rows) +[36/41] pkg/util.go (1 rows) --- ```go package pkg ``` -[25/29] secret/locked.txt - error: open secret/locked.txt: PERMISSION_DENIED +[37/41] secret/locked.txt - error: open secret/locked.txt: PERMISSION_DENIED -[26/29] spaces/file with spaces.txt (1 rows) +[38/41] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[27/29] src/large.txt (100 rows) +[39/41] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -247,13 +315,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[28/29] src/script.py (1 rows) +[40/41] src/script.py (1 rows) --- ```python print('hello') ``` -[29/29] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[41/41] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/036_exclude_dir.golden b/cmd/lx/testdata/golden/036_exclude_dir.golden index eb97fd8..3511de3 100644 --- a/cmd/lx/testdata/golden/036_exclude_dir.golden +++ b/cmd/lx/testdata/golden/036_exclude_dir.golden @@ -1,132 +1,170 @@ --- STDOUT --- -[1/22] README.md (2 rows) +[1/29] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/22] assets/logo.png - binary file skipped (12 B) +[2/29] assets/logo.png - binary file skipped (12 B) -[3/22] configs/custom_sections.yaml (1 rows) +[3/29] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[4/22] configs/custom_template.yaml (1 rows) +[4/29] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[5/22] configs/follow.yaml (1 rows) +[5/29] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[6/22] configs/hidden.yaml (1 rows) +[6/29] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[7/22] configs/no_links.yaml (1 rows) +[7/29] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[8/22] doc/notes.txt (1 rows) +[8/29] doc/notes.txt (1 rows) --- ```text some notes ``` -[9/22] ignore_test/foo.go (1 rows) +[9/29] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[10/29] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[11/29] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[12/29] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[13/29] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[14/29] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[15/29] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[16/29] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[10/22] langs/Dockerfile (1 rows) +[17/29] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[11/22] langs/main.rs (1 rows) +[18/29] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[12/22] langs/script_no_ext (2 rows) +[19/29] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[13/22] links/cycle_a/visible.txt (1 rows) +[20/29] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[14/22] links/cycle_b/visible.txt (1 rows) +[21/29] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[15/22] links/link_to_main.go (~1 rows) +[22/29] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[16/22] links/safe_target/recursion.txt (1 rows) +[23/29] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[17/22] main.go (2 rows) +[24/29] main.go (2 rows) --- ```go package main func main() {} ``` -[18/22] main_test.go (2 rows) +[25/29] main_test.go (2 rows) --- ```go package main import "testing" ``` -[19/22] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[26/29] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[20/22] pkg/util.go (1 rows) +[27/29] pkg/util.go (1 rows) --- ```go package pkg ``` -[21/22] spaces/file with spaces.txt (1 rows) +[28/29] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[22/22] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[29/29] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/040_lines_limit.golden b/cmd/lx/testdata/golden/040_lines_limit.golden index 4f07483..183c562 100644 --- a/cmd/lx/testdata/golden/040_lines_limit.golden +++ b/cmd/lx/testdata/golden/040_lines_limit.golden @@ -1,87 +1,131 @@ --- STDOUT --- -[1/24] README.md (2 rows) +[1/32] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/24] assets/logo.png - binary file skipped (12 B) +[2/32] assets/logo.png - binary file skipped (12 B) -[3/24] configs/custom_sections.yaml (1 rows) +[3/32] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[4/24] configs/custom_template.yaml (1 rows) +[4/32] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[5/24] configs/follow.yaml (1 rows) +[5/32] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[6/24] configs/hidden.yaml (1 rows) +[6/32] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[7/24] configs/no_links.yaml (1 rows) +[7/32] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[8/24] doc/notes.txt (1 rows) +[8/32] doc/notes.txt (1 rows) --- ```text some notes ``` -[9/24] ignore_test/foo.go (1 rows) +[9/32] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[10/32] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[11/32] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[12/32] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[13/32] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[14/32] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[15/32] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[16/32] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[17/32] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[10/24] langs/Dockerfile (1 rows) +[18/32] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[11/24] langs/main.rs (1 rows) +[19/32] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[12/24] langs/script_no_ext (2 rows) +[20/32] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[13/24] links/cycle_a/visible.txt (1 rows) +[21/32] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[14/24] links/cycle_b/visible.txt (1 rows) +[22/32] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[15/24] links/link_to_main.go (~1 rows) +[23/32] links/link_to_main.go (~1 rows) --- ```go package main @@ -90,45 +134,45 @@ package main func main() {} ``` -[16/24] links/safe_target/recursion.txt (1 rows) +[24/32] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[17/24] main.go (2 rows) +[25/32] main.go (2 rows) --- ```go package main func main() {} ``` -[18/24] main_test.go (2 rows) +[26/32] main_test.go (2 rows) --- ```go package main import "testing" ``` -[19/24] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[27/32] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[20/24] pkg/util.go (1 rows) +[28/32] pkg/util.go (1 rows) --- ```go package pkg ``` -[21/24] spaces/file with spaces.txt (1 rows) +[29/32] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[22/24] src/large.txt (100 rows) +[30/32] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -138,13 +182,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[23/24] src/script.py (1 rows) +[31/32] src/script.py (1 rows) --- ```python print('hello') ``` -[24/24] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[32/32] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/090_config_hidden.golden b/cmd/lx/testdata/golden/090_config_hidden.golden index e33a88d..e05571d 100644 --- a/cmd/lx/testdata/golden/090_config_hidden.golden +++ b/cmd/lx/testdata/golden/090_config_hidden.golden @@ -1,5 +1,5 @@ --- STDOUT --- -[1/27] .gitignore (3 rows) +[1/35] .gitignore (3 rows) --- ```gitignore bin/ @@ -7,146 +7,190 @@ secret/ *.tmp ``` -[2/27] .hidden (1 rows) +[2/35] .hidden (1 rows) --- ``` i am hidden ``` -[3/27] README.md (2 rows) +[3/35] README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[4/27] assets/logo.png - binary file skipped (12 B) +[4/35] assets/logo.png - binary file skipped (12 B) -[5/27] configs/custom_sections.yaml (1 rows) +[5/35] configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[6/27] configs/custom_template.yaml (1 rows) +[6/35] configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[7/27] configs/follow.yaml (1 rows) +[7/35] configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[8/27] configs/hidden.yaml (1 rows) +[8/35] configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[9/27] configs/no_links.yaml (1 rows) +[9/35] configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[10/27] doc/notes.txt (1 rows) +[10/35] doc/notes.txt (1 rows) --- ```text some notes ``` -[11/27] ignore_test/.gitignore (1 rows) +[11/35] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[12/35] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[13/35] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[14/35] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[15/35] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[16/35] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[17/35] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[18/35] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[19/35] ignore_test/.gitignore (1 rows) --- ```gitignore bar.go ``` -[12/27] ignore_test/foo.go (1 rows) +[20/35] ignore_test/foo.go (1 rows) --- ```go package foo ``` -[13/27] langs/Dockerfile (1 rows) +[21/35] langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[14/27] langs/main.rs (1 rows) +[22/35] langs/main.rs (1 rows) --- ```rust fn main() {} ``` -[15/27] langs/script_no_ext (2 rows) +[23/35] langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[16/27] links/cycle_a/visible.txt (1 rows) +[24/35] links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[17/27] links/cycle_b/visible.txt (1 rows) +[25/35] links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[18/27] links/link_to_main.go (~1 rows) +[26/35] links/link_to_main.go (~1 rows) --- ```go package main func main() {} ``` -[19/27] links/safe_target/recursion.txt (1 rows) +[27/35] links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[20/27] main.go (2 rows) +[28/35] main.go (2 rows) --- ```go package main func main() {} ``` -[21/27] main_test.go (2 rows) +[29/35] main_test.go (2 rows) --- ```go package main import "testing" ``` -[22/27] parent_ignore_test/level1/level2/keep_me.go (1 rows) +[30/35] parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[23/27] pkg/util.go (1 rows) +[31/35] pkg/util.go (1 rows) --- ```go package pkg ``` -[24/27] spaces/file with spaces.txt (1 rows) +[32/35] spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[25/27] src/large.txt (100 rows) +[33/35] src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -251,13 +295,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[26/27] src/script.py (1 rows) +[34/35] src/script.py (1 rows) --- ```python print('hello') ``` -[27/27] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[35/35] /ROOT/content/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR --- diff --git a/cmd/lx/testdata/golden/100_complex_review_bundle.golden b/cmd/lx/testdata/golden/100_complex_review_bundle.golden index 4da6504..4c6c769 100644 --- a/cmd/lx/testdata/golden/100_complex_review_bundle.golden +++ b/cmd/lx/testdata/golden/100_complex_review_bundle.golden @@ -48,13 +48,20 @@ no_file_links: true Source + ignore_exception_test/src/main.go + +package main + + + + ignore_test/foo.go package foo - + links/link_to_main.go package main @@ -62,7 +69,7 @@ func main() {} - + main.go package main @@ -70,14 +77,14 @@ func main() {} - + parent_ignore_test/level1/level2/keep_me.go package level2 - + pkg/util.go package pkg @@ -88,7 +95,7 @@ package pkg
Tests - + main_test.go package main diff --git a/cmd/lx/testdata/golden/103_complex_ignore_exceptions.golden b/cmd/lx/testdata/golden/103_complex_ignore_exceptions.golden new file mode 100644 index 0000000..d502adc --- /dev/null +++ b/cmd/lx/testdata/golden/103_complex_ignore_exceptions.golden @@ -0,0 +1,47 @@ +--- STDOUT --- +[1/8] ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[2/8] ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[3/8] ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[4/8] ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[5/8] ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[6/8] ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[7/8] ignore_exception_test/src/main.go (1 rows) +--- +```go +package main +``` + +[8/8] ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + + +--- STDERR --- diff --git a/cmd/lx/testdata/golden/241_relative_exclude_parent_dir.golden b/cmd/lx/testdata/golden/241_relative_exclude_parent_dir.golden index e0c019d..e95e27a 100644 --- a/cmd/lx/testdata/golden/241_relative_exclude_parent_dir.golden +++ b/cmd/lx/testdata/golden/241_relative_exclude_parent_dir.golden @@ -1,112 +1,150 @@ --- STDOUT --- -[1/21] ../README.md (2 rows) +[1/28] ../README.md (2 rows) --- ```markdown # Project Documentation here. ``` -[2/21] ../assets/logo.png - binary file skipped (12 B) +[2/28] ../assets/logo.png - binary file skipped (12 B) -[3/21] ../configs/custom_sections.yaml (1 rows) +[3/28] ../configs/custom_sections.yaml (1 rows) --- ```yaml section_header_template: "*** {{ .Body }} ***\n" ``` -[4/21] ../configs/custom_template.yaml (1 rows) +[4/28] ../configs/custom_template.yaml (1 rows) --- ```yaml file_content_template: "File: {{ .Path }}\nContent:\n{{ .Content }}" ``` -[5/21] ../configs/follow.yaml (1 rows) +[5/28] ../configs/follow.yaml (1 rows) --- ```yaml follow_symlinks: true ``` -[6/21] ../configs/hidden.yaml (1 rows) +[6/28] ../configs/hidden.yaml (1 rows) --- ```yaml show_hidden: true ``` -[7/21] ../configs/no_links.yaml (1 rows) +[7/28] ../configs/no_links.yaml (1 rows) --- ```yaml no_file_links: true ``` -[8/21] ../doc/notes.txt (1 rows) +[8/28] ../doc/notes.txt (1 rows) --- ```text some notes ``` -[9/21] ../ignore_test/foo.go (1 rows) +[9/28] ../ignore_exception_test/assets/logo.png - binary file skipped (10 B) + +[10/28] ../ignore_exception_test/data/index.json (1 rows) +--- +```json +{} +``` + +[11/28] ../ignore_exception_test/data/nested/deep/my.data.xlsx (1 rows) +--- +``` +excel_data +``` + +[12/28] ../ignore_exception_test/langgraph.json (1 rows) +--- +```json +{} +``` + +[13/28] ../ignore_exception_test/migrations/001_init.sql (1 rows) +--- +```sql +SELECT 1; +``` + +[14/28] ../ignore_exception_test/pyproject.toml (1 rows) +--- +```toml +[tool] +``` + +[15/28] ../ignore_exception_test/uv.lock (1 rows) +--- +``` +lock_data +``` + +[16/28] ../ignore_test/foo.go (1 rows) --- ```go package foo ``` -[10/21] ../langs/Dockerfile (1 rows) +[17/28] ../langs/Dockerfile (1 rows) --- ```dockerfile FROM scratch ``` -[11/21] ../langs/script_no_ext (2 rows) +[18/28] ../langs/script_no_ext (2 rows) --- ```bash #!/bin/bash echo hi ``` -[12/21] ../links/cycle_a/visible.txt (1 rows) +[19/28] ../links/cycle_a/visible.txt (1 rows) --- ```text a ``` -[13/21] ../links/cycle_b/visible.txt (1 rows) +[20/28] ../links/cycle_b/visible.txt (1 rows) --- ```text b ``` -[14/21] ../links/link_to_main.go (~2 rows) +[21/28] ../links/link_to_main.go (~2 rows) --- ```go package main func main() {} ``` -[15/21] ../links/safe_target/recursion.txt (1 rows) +[22/28] ../links/safe_target/recursion.txt (1 rows) --- ```text I am safe ``` -[16/21] ../parent_ignore_test/level1/level2/keep_me.go (1 rows) +[23/28] ../parent_ignore_test/level1/level2/keep_me.go (1 rows) --- ```go package level2 ``` -[17/21] ../pkg/util.go (1 rows) +[24/28] ../pkg/util.go (1 rows) --- ```go package pkg ``` -[18/21] ../spaces/file with spaces.txt (1 rows) +[25/28] ../spaces/file with spaces.txt (1 rows) --- ```text content with spaces ``` -[19/21] ../src/large.txt (100 rows) +[26/28] ../src/large.txt (100 rows) --- ```text Line xxxxxxxxxx @@ -211,13 +249,13 @@ Line xxxxxxxxxx Line xxxxxxxxxx ``` -[20/21] ../src/script.py (1 rows) +[27/28] ../src/script.py (1 rows) --- ```python print('hello') ``` -[21/21] ../ROOT/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND +[28/28] ../ROOT/links/broken_link - error: open /ROOT/content/links/broken_link: FILE_NOT_FOUND --- STDERR ---