Skip to content

Commit 7d2c8f9

Browse files
author
Tomas Trajan Herich (u803909)
committed
feat: better file exclusion defaults
exclude both .something (was already the case) and some/.thing (.files in nested folders)
1 parent 2d718da commit 7d2c8f9

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

lib/checks/content.check.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ export function contentCheckTaskFactory(
6969
contentPatternFlags,
7070
DEFAULT_CONTENT_PATTERN_FLAGS
7171
);
72-
const regexp = new RegExp(contentPattern, activeContentPatternFlags);
72+
const regexp = new RegExp(
73+
contentPattern,
74+
activeContentPatternFlags
75+
);
7376

7477
const matchesForFile = [];
7578

lib/checks/xpath.check.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export function xpathCheckTaskFactory(
7272
) ?? {};
7373
const xpathSelect = xpath.useNamespaces(namespaces);
7474

75-
const result: any = xpathSelect(definition.xpathExpression, document);
75+
const result: any = xpathSelect(
76+
definition.xpathExpression,
77+
document
78+
);
7679
const resultMatches: any[] = [];
7780

7881
if (

lib/consts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const DEFAULT_INCLUDE_FILES_FLAG = 'i';
2-
export const DEFAULT_EXCLUDE_FILES_PATTERN_XPATH = `(^\\.|node_modules|coverage|dist|.teamcity)`;
3-
export const DEFAULT_EXCLUDE_FILES_PATTERN_CONTENT = `(^\\.|node_modules|coverage|dist)`;
2+
export const DEFAULT_EXCLUDE_FILES_PATTERN_XPATH = `((^|\\/)\\.|node_modules|coverage|dist|.teamcity)`;
3+
export const DEFAULT_EXCLUDE_FILES_PATTERN_CONTENT = `((^|\\/)\\.|node_modules|coverage|dist)`;
44
export const DEFAULT_EXCLUDE_FILES_PATTERN_SIZE = `node_modules`;
55
export const DEFAULT_EXCLUDE_FILES_PATTERN_FLAGS = 'i';
6-
export const DEFAULT_CHECK_EXECUTION_TIMEOUT = 10_000; // 10s
6+
export const DEFAULT_CHECK_EXECUTION_TIMEOUT = 10_000; // 10s

0 commit comments

Comments
 (0)