Skip to content

Commit 80f8bda

Browse files
committed
fix(discover): retain external source directories in fast mode
`external` was listed in FAST_SKIP_DIRS, so fast and moderate discovery silently dropped every directory named `external`. In many codebases that name holds first-party code (external-facing APIs, adapters, integration layers) rather than vendored third-party sources, and the dedicated `vendor` / `third_party` / `3rdparty` entries already cover the vendored case. Remove `external` from the fast skip list so those sources are indexed in every mode. The shortened list is regrouped with category comments in the same style as ALWAYS_SKIP_DIRS; element order is unchanged. Signed-off-by: Hubert Tarnacki <hubert.tarnacki@gmail.com>
1 parent 339b3f4 commit 80f8bda

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

‎src/discover/discover.c‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,23 @@ static const char *ALWAYS_SKIP_DIRS[] = {
5252
".codebase-memory", ".qdrant_code_embeddings", ".tmp", "vendor", "vendored", NULL};
5353

5454
static const char *FAST_SKIP_DIRS[] = {
55-
"generated", "gen", "auto-generated", "fixtures", "testdata", "test_data",
56-
"__tests__", "__mocks__", "__snapshots__", "__fixtures__", "__test__", "docs",
57-
"doc", "documentation", "examples", "example", "samples", "sample",
58-
"assets", "static", "public", "media", "third_party", "thirdparty",
59-
"3rdparty", "external", "migrations", "seeds", "e2e", "integration",
60-
"locale", "locales", "i18n", "l10n", "scripts", "tools",
61-
"hack", "bin", "build", "out", NULL};
55+
/* Generated */
56+
"generated", "gen", "auto-generated",
57+
/* Tests */
58+
"fixtures", "testdata", "test_data", "__tests__", "__mocks__", "__snapshots__", "__fixtures__",
59+
"__test__",
60+
/* Docs and samples */
61+
"docs", "doc", "documentation", "examples", "example", "samples", "sample",
62+
/* Assets */
63+
"assets", "static", "public", "media",
64+
/* Third-party */
65+
"third_party", "thirdparty", "3rdparty",
66+
/* Data and integration tests */
67+
"migrations", "seeds", "e2e", "integration",
68+
/* Localization */
69+
"locale", "locales", "i18n", "l10n",
70+
/* Tooling and build output */
71+
"scripts", "tools", "hack", "bin", "build", "out", NULL};
6272

6373
/* ── Ignored suffixes ───────────────────────────────── */
6474

‎tests/test_discover.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ TEST(skip_fast_e2e) {
153153
ASSERT_TRUE(cbm_should_skip_dir("e2e", CBM_MODE_FAST));
154154
PASS();
155155
}
156+
TEST(no_skip_fast_external) {
157+
ASSERT_FALSE(cbm_should_skip_dir("external", CBM_MODE_FAST));
158+
ASSERT_FALSE(cbm_should_skip_dir("external", CBM_MODE_MODERATE));
159+
ASSERT_FALSE(cbm_should_skip_dir("shop-external-api", CBM_MODE_FAST));
160+
PASS();
161+
}
156162

157163
/* ── Suffix filters ────────────────────────────────────────────── */
158164

@@ -1867,6 +1873,7 @@ SUITE(discover) {
18671873
RUN_TEST(skip_fast_assets);
18681874
RUN_TEST(skip_fast_3rdparty);
18691875
RUN_TEST(skip_fast_e2e);
1876+
RUN_TEST(no_skip_fast_external);
18701877

18711878
/* Suffix filters */
18721879
RUN_TEST(suffix_pyc);

0 commit comments

Comments
 (0)