Closed kevastator closed 1 week ago
Sorry about taking so long to respond to this. I looked at it and I just had a couple questions/suggestion type things :
const query = `
query($owner: String!, $repoName: String!) {
repository(owner: $owner, name: $repoName) {
licenseInfo {
key
}
}
}
`;
MIT, LGPL-2.1, BSD-3-Clause
. Were there any more that we need to worry about and do we need to worry if someone has the license as like BSD 3-Clause
or no?try {
var response = await graphqlRequest(query, { owner, repoName });
var licenseName = response?.data?.repository?.licenseInfo?.key?.toUpperCase();
} catch (error) {
logger.error(`Failed to fetch license info for ${owner}/${repoName}: ${error}`);
return [0, (new Date().getTime() - start) / 1000]; // Return 0 and elapsed time in case of failure (or whatever else we want to be the error)
}
main
instead of master
is that just a naming convention thing or something we should check? (Something like this?)
let responseMd = await fetch(`https://raw.githubusercontent.com/${owner}/${repoName}/master/README.md`);
if (!responseMd.ok) {
responseMd = await fetch(`https://raw.githubusercontent.com/${owner}/${repoName}/main/README.md`);
}
That's all I could try to be critical of (this looks great, and I know you put a lot of work in it, I am just trying to play devil's advocate)
I will reply to each issue in order:
Thanks for the great ideas. I will add some and submit a pull request with the changes in mind!
Resolves #17 .Finished adding some Markdown parsing checks!