Skip to content

Commit

Permalink
couple chagnes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Duda committed Mar 4, 2024
1 parent 1bdb0be commit 08cf8f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/Commands/runCommitCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export function runCommitCommand(args: Array<string>, root: string) {
.filter(fileData => !fileTagsDatabase.isIgnored(fileData.newPath) && !config.isFileExtensionIgnored(fileData.newPath));

fileTagger.start(fileDataToTag).then(() => {

// Add relevancy info

console.log("\nAll files tagged. Saving to database...");
fileTagsDatabase.save();
});

});
}
4 changes: 4 additions & 0 deletions src/Commands/runReportForCommitCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export function runReportForCommitCommand(args: Array<string>, root: string) {
repository.getCommitByHash(hash).then(async (commit: Commit) => {
const relevancyMap = relevancyManager.loadRelevancyMapFromCommits([commit]);
const report = await generator.generateReportForCommit(commit, projects[0].name, relevancyMap);
if (generator.isReportEmpty(report)) {
console.log("Report is empty (no tags were found in modified files).");
return;
}
generator.getReportAsJiraComment(report, true);
});
}
4 changes: 1 addition & 3 deletions src/Report/ReportGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ export class ReportGenerator {
return fileInfoArray;
}
private _getUsedIn(fileData: FileData, relevancy: Relevancy | null) {
// TODO: Add some logging explainig why we do that
console.log(relevancy);
if (relevancy === Relevancy.HIGH) {
return this._getFileReferences(fileData.newPath);
} else {
Expand Down Expand Up @@ -308,6 +306,6 @@ export class ReportGenerator {
}

public isReportEmpty(report: Report): boolean {
return report.allModules.some(moduleReport => moduleReport.files.some(file => file.tagIdentifiers.length));
return report.allModules.length === 0;
}
}

0 comments on commit 08cf8f8

Please sign in to comment.