Skip to content

Commit

Permalink
Added more files to ignore (#173)
Browse files Browse the repository at this point in the history
This ignores test files not only with dots in their names but also with `-`.
  • Loading branch information
max-leuthaeuser committed May 17, 2022
1 parent 1c22a95 commit ecd6369
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/io/shiftleft/js2cpg/io/FileDefaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object FileDefaults {
)

val IGNORED_TESTS_REGEX: Seq[Regex] =
List(".*\\.spec\\.js".r, ".*\\.mock\\.js".r, ".*\\.e2e\\.js".r, ".*\\.test\\.js".r)
List(".*[.-]spec\\.js".r, ".*[.-]mock\\.js".r, ".*[.-]e2e\\.js".r, ".*[.-]test\\.js".r)

val IGNORED_FOLDERS_REGEX: Seq[Regex] =
List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,7 @@ class TranspilationRunner(projectPath: Path, tmpTranspileDir: Path, config: Conf
packageJson.writeText(originalContent)

// restore lock files
List(
PackageJsonParser.JSON_LOCK_FILENAME,
PackageJsonParser.YARN_LOCK_FILENAME,
PackageJsonParser.PNPM_LOCK_FILENAME
).map(f => File(projectPath, f + ".bak")).collect {
PackageJsonParser.LOCKFILES.map(f => File(projectPath, f + ".bak")).collect {
case lockFile if lockFile.exists =>
lockFile.renameTo(lockFile.pathAsString.stripSuffix(".bak"))
}
Expand Down

0 comments on commit ecd6369

Please sign in to comment.