Set up CI with ESLint linter and Mocha test runner (#661)

This commit is contained in:
Thomas Durieux
2026-04-15 04:34:03 +02:00
committed by GitHub
parent 812f8b6314
commit f3641c8ce3
14 changed files with 1991 additions and 38 deletions
+1
View File
@@ -281,6 +281,7 @@ export default class AnonymizedFile {
.startActiveSpan("AnonymizedFile.send", async (span) => {
span.setAttribute("repoId", this.repository.repoId);
span.setAttribute("anonymizedPath", this.anonymizedPath);
// eslint-disable-next-line no-async-promise-executor
return new Promise<void>(async (resolve, reject) => {
try {
if (config.STREAMER_ENTRYPOINT) {
+2 -2
View File
@@ -135,7 +135,7 @@ export default class User {
}).exec()
).map((d) => new Repository(d));
const promises = [];
for (let repo of repositories) {
for (const repo of repositories) {
if (
repo.status == "ready" &&
repo.options.expirationMode != "never" &&
@@ -163,7 +163,7 @@ export default class User {
}).exec()
).map((d) => new PullRequest(d));
const promises = [];
for (let repo of pullRequests) {
for (const repo of pullRequests) {
if (
repo.status == "ready" &&
repo.options.expirationMode != "never" &&
+1 -1
View File
@@ -96,7 +96,7 @@ export class ContentAnonimizer {
}
// remove image in markdown
return content.replace(
/!\[[^\]]*\]\((?<filename>.*?)(?=\"|\))(?<optionalpart>\".*\")?\)/g,
/!\[[^\]]*\]\((?<filename>.*?)(?="|\))(?<optionalpart>".*")?\)/g,
() => {
this.wasAnonymized = true;
return config.ANONYMIZATION_MASK;
+1 -1
View File
@@ -106,7 +106,7 @@ export default class GitHubStream extends GitHubBase {
span.setAttribute("file", file.anonymizedPath);
try {
try {
file.filePath;
void file.filePath;
} catch (_) {
// compute the original path if ambiguous
await file.originalPath();
+3 -3
View File
@@ -145,10 +145,10 @@ export default class FileSystem extends StorageBase {
.startActiveSpan("fs.listFiles", async (span) => {
span.setAttribute("path", dir);
const fullPath = join(config.FOLDER, this.repoPath(repoId), dir);
let files = await fs.promises.readdir(fullPath);
const files = await fs.promises.readdir(fullPath);
const output2: IFile[] = [];
for (let file of files) {
let filePath = join(fullPath, file);
for (const file of files) {
const filePath = join(fullPath, file);
try {
const stats = await fs.promises.stat(filePath);
if (stats.isDirectory()) {