Skip to content

Commit 7adfeca

Browse files
committed
refactor: update paths.ts
1 parent afc0f8a commit 7adfeca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/paths.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import * as path from "path";
77
import { ROOT } from "../lib/constants";
88
import { MoveOrRename, SplitPathResult } from "./paths.d";
99

10-
const REPEAT_PATH_STARTS = ["readme", "index"];
10+
// The starts of filenames which could be repeated in a repo. All lowercase here.
11+
const REPEAT_FILENAMES = ["readme", "index", '__init__.py'];
12+
1113
/**
1214
* Get metadata for a given path.
1315
*
@@ -44,7 +46,7 @@ export function friendlyFile(filePath: string) {
4446

4547
const nameLower = name.toLowerCase();
4648

47-
for (const p of REPEAT_PATH_STARTS) {
49+
for (const p of REPEAT_FILENAMES) {
4850
if (nameLower.startsWith(p)) {
4951
return filePath;
5052
}

0 commit comments

Comments
 (0)