1- const fs = require ( "fs" ) . promises
1+ const fs = require ( 'fs' ) . promises
22const path = require ( 'path' )
33
44const CONFIG = {
5- repoFilePath : path . resolve ( __dirname , " ../codegov.json" ) ,
6- issueFilePath : path . resolve ( __dirname , " ../issue-pool.json" ) ,
5+ repoFilePath : path . resolve ( __dirname , ' ../codegov.json' ) ,
6+ issueFilePath : path . resolve ( __dirname , ' ../issue-pool.json' ) ,
77 regex : / h t t p s ? : \/ \/ g i t h u b \. c o m \/ ( [ ^ \/ ] + ) \/ ( [ ^ \/ ] + ) / ,
88 githubToken : process . env . GITHUB_TOKEN ,
99 requiredLabel : 'code-gov' ,
@@ -41,10 +41,10 @@ async function fetchWithRateLimit(url, options = {}) {
4141}
4242
4343async function getRepoInfo ( ) { // dont know how i feel about this double loop setup...
44- let repoInfo = [ ]
44+ const repoInfo = [ ]
4545
4646 try {
47- const content = await fs . readFile ( CONFIG . repoFilePath , " utf-8" )
47+ const content = await fs . readFile ( CONFIG . repoFilePath , ' utf-8' )
4848 const jsonData = JSON . parse ( content )
4949
5050 for ( const agencyKey in jsonData ) {
@@ -71,7 +71,7 @@ async function getRepoInfo() { // dont know how i feel about this double loop se
7171 }
7272 }
7373 } catch ( error ) {
74- console . error ( " Error in getting repo information:" , error )
74+ console . error ( ' Error in getting repo information:' , error )
7575 }
7676
7777 // console.log(repoInfo)
@@ -102,11 +102,11 @@ function transformIssue(issue, repo, repoLanguage) {
102102 id : String ( issue . id ) ,
103103 number : issue . number ,
104104 url : issue . html_url ,
105- content_title : issue . title || "" ,
106- content_description : issue . body || "" ,
105+ content_title : issue . title || '' ,
106+ content_description : issue . body || '' ,
107107 repo_name : repo . repoName ,
108108 repo_url : `https://github.com/${ repo . ownerName } /${ repo . repoName } ` ,
109- repo_language : repoLanguage || "" ,
109+ repo_language : repoLanguage || '' ,
110110 repo_owner : repo . ownerName ,
111111 status_is_open : issue . state === 'open' ,
112112 status_has_assignee : issue . assignee !== null ,
@@ -115,9 +115,9 @@ function transformIssue(issue, repo, repoLanguage) {
115115 time_last_updated : issue . updated_at ,
116116 time_days_old : daysBetween ( createdDate , now ) ,
117117 time_last_activity_days_ago : daysBetween ( updatedDate , now ) ,
118- people_author : issue . user ?. login || "" ,
118+ people_author : issue . user ?. login || '' ,
119119 people_assignee : issue . assignee ?. login || null ,
120- people_author_type : issue . user ?. type || "" ,
120+ people_author_type : issue . user ?. type || '' ,
121121 labels_list : labelNames ,
122122 labels_count : labelNames . length ,
123123 labels_has_priority : checkLabelKeywords ( issue . labels , [ 'priority' , 'p0' , 'p1' , 'p2' , 'urgent' ] ) ,
@@ -146,7 +146,7 @@ async function processSingleRepository(repo, headers) {
146146 }
147147
148148 const repoData = await repoResponse . json ( )
149- const repoLanguage = repoData . language || ""
149+ const repoLanguage = repoData . language || ''
150150
151151 let page = 1
152152 let hasMore = true
@@ -215,9 +215,9 @@ async function updateIssuePool() {
215215
216216 try {
217217 await fs . writeFile ( CONFIG . issueFilePath , JSON . stringify ( issuePool , null , 2 ) )
218- console . log ( ` Successfully saved issues!` )
218+ console . log ( ' Successfully saved issues!' )
219219 } catch ( error ) {
220- console . error ( " Error saving issue pool:" , error )
220+ console . error ( ' Error saving issue pool:' , error )
221221 }
222222
223223 return issuePool
0 commit comments