-
-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into Gsoc'24-duplixx-Event-Attendance
- Loading branch information
Showing
457 changed files
with
52,669 additions
and
27,080 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ reviews: | |
drafts: false | ||
base_branches: | ||
- develop | ||
- main | ||
chat: | ||
auto_reply: true | ||
auto_reply: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import fs from 'fs/promises'; // Import fs.promises for async operations | ||
import path from 'path'; | ||
|
||
// List of files to skip | ||
const filesToSkip = [ | ||
'index.tsx', | ||
'EventActionItems.tsx', | ||
'OrgPostCard.tsx', | ||
'UsersTableItem.tsx', | ||
'FundCampaignPledge.tsx' | ||
]; | ||
|
||
// Recursively find all .tsx files, excluding files listed in filesToSkip | ||
async function findTsxFiles(dir) { | ||
let results = []; | ||
try { | ||
const list = await fs.readdir(dir); | ||
for (const file of list) { | ||
const filePath = path.join(dir, file); | ||
const stat = await fs.stat(filePath); | ||
if (stat.isDirectory()) { | ||
results = results.concat(await findTsxFiles(filePath)); | ||
} else if ( | ||
filePath.endsWith('.tsx') && | ||
!filePath.endsWith('.test.tsx') && | ||
!filesToSkip.includes(path.relative(dir, filePath)) | ||
) { | ||
results.push(filePath); | ||
} | ||
} | ||
} catch (err) { | ||
console.error(`Error reading directory ${dir}: ${err.message}`); | ||
} | ||
return results; | ||
} | ||
|
||
// Check if a file contains at least one TSDoc comment | ||
async function containsTsDocComment(filePath) { | ||
try { | ||
const content = await fs.readFile(filePath, 'utf8'); | ||
return /\/\*\*[\s\S]*?\*\//.test(content); | ||
} catch (err) { | ||
console.error(`Error reading file ${filePath}: ${err.message}`); | ||
return false; | ||
} | ||
} | ||
|
||
// Main function to run the validation | ||
async function run() { | ||
const dir = process.argv[2] || './src'; // Allow directory path as a command-line argument | ||
const files = await findTsxFiles(dir); | ||
const filesWithoutTsDoc = []; | ||
|
||
for (const file of files) { | ||
if (!await containsTsDocComment(file)) { | ||
filesWithoutTsDoc.push(file); | ||
} | ||
} | ||
|
||
if (filesWithoutTsDoc.length > 0) { | ||
filesWithoutTsDoc.forEach(file => { | ||
console.error(`No TSDoc comment found in file: ${file}`); | ||
}); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.