Skip to content

Commit 820cd02

Browse files
authored
Merge pull request DeusData#2161 from htarnacki/fix/discover-external-fast-mode
fix(discover): retain external source directories in fast mode (DeusData#2151)
2 parents 1f934b6 + df2c35f commit 820cd02

3 files changed

Lines changed: 24 additions & 8 deletions

File tree

‎src/discover/discover.c‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,23 @@ static const char *ALWAYS_SKIP_DIR_SUFFIXES[] = {
7575
"storage/framework/views", NULL};
7676

7777
static const char *FAST_SKIP_DIRS[] = {
78-
"generated", "gen", "auto-generated", "fixtures", "testdata", "test_data",
79-
"__tests__", "__mocks__", "__snapshots__", "__fixtures__", "__test__", "docs",
80-
"doc", "documentation", "examples", "example", "samples", "sample",
81-
"assets", "static", "public", "media", "third_party", "thirdparty",
82-
"3rdparty", "external", "migrations", "seeds", "e2e", "integration",
83-
"locale", "locales", "i18n", "l10n", "scripts", "tools",
84-
"hack", "bin", "build", "out", NULL};
78+
/* Generated */
79+
"generated", "gen", "auto-generated",
80+
/* Tests */
81+
"fixtures", "testdata", "test_data", "__tests__", "__mocks__", "__snapshots__", "__fixtures__",
82+
"__test__",
83+
/* Docs and samples */
84+
"docs", "doc", "documentation", "examples", "example", "samples", "sample",
85+
/* Assets */
86+
"assets", "static", "public", "media",
87+
/* Third-party */
88+
"third_party", "thirdparty", "3rdparty",
89+
/* Data and integration tests */
90+
"migrations", "seeds", "e2e", "integration",
91+
/* Localization */
92+
"locale", "locales", "i18n", "l10n",
93+
/* Tooling and build output */
94+
"scripts", "tools", "hack", "bin", "build", "out", NULL};
8595

8696
/* ── Ignored suffixes ───────────────────────────────── */
8797

‎tests/repro/repro_invariant_discovery_fqn.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ TEST(invariant_discovery_fast_skip_dirs) {
288288
{ "public" },
289289
{ "third_party" },
290290
{ "thirdparty" },
291-
{ "external" },
292291
{ "migrations" },
293292
{ "build" }, /* build is in FAST_SKIP_DIRS, not ALWAYS */
294293
{ "bin" },

‎tests/test_discover.c‎

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

158164
/* ── Suffix filters ────────────────────────────────────────────── */
159165

@@ -2474,6 +2480,7 @@ SUITE(discover) {
24742480
RUN_TEST(skip_fast_assets);
24752481
RUN_TEST(skip_fast_3rdparty);
24762482
RUN_TEST(skip_fast_e2e);
2483+
RUN_TEST(no_skip_fast_external);
24772484

24782485
/* Suffix filters */
24792486
RUN_TEST(suffix_pyc);

0 commit comments

Comments
 (0)