Pietro Marangon
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 631 additions and 352 deletions
-
8.github/CONTRIBUTING.md
-
19.github/PULL_REQUEST_TEMPLATE.md
-
17.travis.yml
-
88AUTHORS.md
-
88Makefile
-
444README.md
-
21non-free.md
-
2tests/check-github-commit-dates.py
-
284tests/test.js
@ -1,16 +1,16 @@ |
|||
## Contributing |
|||
|
|||
Please open a new issue to clarify any questions, or post in the [General discussion issue](https://github.com/Kickball/awesome-selfhosted/issues/89). |
|||
Please open a new issue to clarify any questions, or post in the [General discussion issue](https://github.com/awesome-selfhosted/awesome-selfhosted/issues/89). |
|||
|
|||
All guidelines for adding new software to the list are listed in [PULL_REQUEST_TEMPLATE.md](PULL_REQUEST_TEMPLATE.md). |
|||
|
|||
Other recommendations: |
|||
|
|||
- To add a new entry, [edit the README.md file](https://github.com/Kickball/awesome-selfhosted/edit/master/README.md) through Github's web interface or a text editor, and send a Pull Request. |
|||
- To add a new entry, [edit the README.md file](https://github.com/awesome-selfhosted/awesome-selfhosted/edit/master/README.md) through Github's web interface or a text editor, and send a Pull Request. |
|||
- See [Editing files in another user's repository](https://help.github.com/articles/editing-files-in-another-user-s-repository/), [Creating Pull Requests](https://help.github.com/articles/creating-a-pull-request/), [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) for help on sending your patch. |
|||
- A script to help you format new entries is available at (it requires `make` to be installed): `git clone`/[download](https://github.com/Kickball/awesome-selfhosted/archive/master.zip) and enter the repository, run `make add` and follow the instructions. |
|||
- A script to help you format new entries is available at (it requires `make` to be installed): `git clone`/[download](https://github.com/awesome-selfhosted/awesome-selfhosted/archive/master.zip) and enter the repository, run `make add` and follow the instructions. |
|||
- A website to help you format new entries is available at https://n8225.github.io/ |
|||
- The list of contributors can be updated with `make contrib`. |
|||
- Software with no development activity for 6-12 months may be removed from the list. |
|||
- Don't know where to start? Check issues labeled [`help wanted`](https://github.com/Kickball/awesome-selfhosted/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [`fix`](https://github.com/Kickball/awesome-selfhosted/issues?q=is%3Aissue+is%3Aopen+label%3Afix). |
|||
- Don't know where to start? Check issues labeled [`help wanted`](https://github.com/awesome-selfhosted/awesome-selfhosted/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [`fix`](https://github.com/awesome-selfhosted/awesome-selfhosted/issues?q=is%3Aissue+is%3Aopen+label%3Afix). |
|||
|
@ -1,72 +1,52 @@ |
|||
#!/usr/bin/make -f
|
|||
SHELL = /bin/bash |
|||
all: checks |
|||
AWESOME_BOT_OPTIONS = --allow-redirect --skip-save-results --allow 202 --white-list airsonic.github.io/docs/apps |
|||
|
|||
checks: nolicenselanguage nofullstop longdescriptions syntaxerrors |
|||
all: check_all |
|||
|
|||
monthly: checks awesome_bot check_github_commit_dates contrib |
|||
# run all checks
|
|||
check_all: check_syntax_full awesome_bot check_github_commit_dates |
|||
|
|||
noexternallink: |
|||
@echo -e "\nLines with no source/demo/other link:" |
|||
@sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep --color=always '[a-z\.] `' |
|||
# check pull requests
|
|||
check_pr: check_syntax_diff |
|||
|
|||
nolicenselanguage: |
|||
@echo -e "\nLines with only 1 or no language/license entry:" |
|||
@! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep -v '` `' |
|||
# check syntax in whole file
|
|||
check_syntax_full: |
|||
node tests/test.js -r README.md |
|||
|
|||
nofullstop: |
|||
@echo -e "\nLines without a full stop after description:" |
|||
@! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '[a-z] \(\[' |
|||
@! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '[a-z] `' |
|||
# check syntax in the diff from master to current branch
|
|||
check_syntax_diff: |
|||
git diff origin/master -U0 README.md | grep --perl-regexp --only-matching "(?<=^\+).*" >> temp.md && \
|
|||
node tests/test.js -r README.md -d temp.md && \
|
|||
awesome_bot -f temp.md $(AWESOME_BOT_OPTIONS) |
|||
|
|||
longdescriptions: |
|||
@echo -e "\nDescriptions exceeding 250 chars:" |
|||
@! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep --only-matching '\) - [Aa-Zz|.|\(|\)|/| |,|-]*\s\(\[' README.md | grep '.\{257\}' |
|||
|
|||
syntaxerrors: |
|||
@echo -e "\nSyntax errors:" |
|||
@! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '\)\(|``|\)`' |
|||
|
|||
#################################
|
|||
|
|||
contrib: |
|||
@mv .github/.mailmap . && printf "|Commits | Author |\n| :---: | --- |\n" > AUTHORS.md && git shortlog -sne | sed -r 's/^\s*([[:digit:]]*?)\s*?(.*?)/|\1|\2|/' >> AUTHORS.md && mv .mailmap .github/.mailmap |
|||
|
|||
awesome_bot: |
|||
# check dead links
|
|||
# https://github.com/dkhamsing/awesome_bot
|
|||
awesome_bot --allow-redirect -f README.md |
|||
awesome_bot: |
|||
awesome_bot -f README.md $(AWESOME_BOT_OPTIONS) |
|||
|
|||
# check date of last commit for github.com repository URLs
|
|||
check_github_commit_dates: |
|||
pip3 install PyGithub |
|||
python3 tests/check-github-commit-dates.py |
|||
|
|||
#################################
|
|||
|
|||
# update the AUTHORS.md file
|
|||
contrib: |
|||
@mv .github/.mailmap . && printf "|Commits | Author |\n| :---: | --- |\n" > AUTHORS.md && git shortlog -sne | sed -r 's/^\s*([[:digit:]]*?)\s*?(.*?)/|\1|\2|/' >> AUTHORS.md && mv .mailmap .github/.mailmap |
|||
|
|||
# add a new entry
|
|||
add: |
|||
@#add a new entry |
|||
@printf 'Software name: ' ;\
|
|||
read Name; if [ -z "$$Name" ]; then printf 'Missing software name!\n'; exit 1 ; fi ;\
|
|||
printf 'Homepage URL: ' ;\
|
|||
read Url; if [ -z "$$Url" ]; then printf 'Missing main project URL!\n'; exit 1 ; fi ;\
|
|||
printf 'Description (max 250 characters, ending with .): ' ;\
|
|||
read Description; if [ -z "$$Description" ]; then printf 'Missing description!\n'; exit 1 ; fi ;\
|
|||
printf 'License: ' ;\
|
|||
read License; if [ -z "$$License" ]; then printf 'Missing license!\n'; exit 1 ; fi ;\
|
|||
printf 'Main server-side language/platform/requirement: ' ;\
|
|||
read Language; if [ -z "$$Language" ]; then printf 'Missing language!\n'; exit 1 ; fi ;\
|
|||
printf 'Demo URL (if any): ' ;\
|
|||
read Demo; if [ -z "$$Demo" ]; then CDemo="" ; else CDemo="[Demo]($$Demo)" ; fi ;\
|
|||
printf 'Source code URL (if different from Homepage): ' ;\
|
|||
read Source; if [ -z "$$Source" ]; then CSource="" ; else CSource="[Source Code]($$Source)" ; fi ;\
|
|||
if [[ "$$CSource" == "" && "$$Demo" == "" ]]; \
|
|||
then Moreinfo=""; \
|
|||
else Moreinfo=$$(echo "($$CDemo$$CSource)" | sed 's|)\[|), [|g') ;\
|
|||
fi ;\
|
|||
echo -e "Copy this entry to your clipboard, paste it in the appropriate category:\n\n" ;\
|
|||
@read -r -p "Software name: " Name && [[ ! -z "$$Name" ]] && \
|
|||
read -r -p "Homepage/URL: " Url && [[ ! -z "$$Url" ]] && \
|
|||
read -r -p "Description (max 250 characters, ending with .): " Description && [[ ! -z "$$Description" ]] && \
|
|||
read -r -p "License: " License && [[ ! -z "$$License" ]] && \
|
|||
read -r -p "Main server-side language/platform/requirement: " Language && [[ ! -z "$$Language" ]] && \
|
|||
read -r -p "Demo URL (optional,leave empty): " Demo && \
|
|||
if [[ "$$Demo" == "" ]]; then CDemo=""; else CDemo="[Demo]($$Demo)"; fi; \
|
|||
read -r -p "Source code URL (if different from homepage): " Source && \
|
|||
if [[ "$$Source" == "" ]]; then CSource=""; else CSource="[Source Code]($$Source)"; fi; \
|
|||
if [[ "$$CSource" == "" && "$$Demo" == "" ]]; then Moreinfo=""; else Moreinfo="($$CDemo $$CSource)"; fi; \
|
|||
echo "Copy this entry to your clipboard, paste it in the appropriate category:" ;\
|
|||
echo "- [$$Name]($$Url) - $${Description} $${Moreinfo} \`$$License\` \`$$Language\`" |
|||
|
|||
|
|||
#TODO ask for category and insert item accordingly
|
|||
#TODO check for unsorted entries
|
|||
#TODO automatically sort entries/sections
|
|||
#TODO autoupdate contributors list
|
444
README.md
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,91 +1,251 @@ |
|||
// Accepts input of any filename, ie. node test.js README.md
|
|||
// USAGE:
|
|||
// node test.js -r README.md (Checks whole file)
|
|||
// node test.js -r README.md -d temp.md (Checks just the diff)
|
|||
|
|||
const fs = require('fs'); |
|||
const chalk = require('chalk'); |
|||
let licenses = new Set(); |
|||
let pr = false; |
|||
let readme; |
|||
let diff; |
|||
|
|||
let log = '{\n'; |
|||
let issuelog = ' "message": "#### Syntax Issues\\n\\n Name | Entry\\n----|----------------------\\n'; |
|||
let fails = '' |
|||
const file = fs.readFileSync(process.argv[2], 'utf8'); // Reads argv into var file
|
|||
//Parse the command options and set the pr var
|
|||
function parseArgs(args) { |
|||
if ( args.indexOf('-r', 2) > 0 ) { |
|||
readme = fs.readFileSync(args[args.indexOf('-r', 2)+1], 'utf8') |
|||
} |
|||
if (args.indexOf('-d', 2) > 0) { |
|||
pr = true; |
|||
diff = fs.readFileSync(args[args.indexOf('-d', 2)+1], 'utf8'); |
|||
} |
|||
if ( pr === true) { |
|||
console.log(chalk.blue(`Running on PR. README.md: ${args[args.indexOf('-r', 2)+1]} diff: ${args[args.indexOf('-d', 2)+1]}`)) |
|||
} |
|||
} |
|||
|
|||
function entryFilter(md) { // Function to find lines with entries
|
|||
// Function to find lines with entries
|
|||
function entryFilter(md) { |
|||
const linepatt = /^\s{0,2}-\s\[.*`/; |
|||
return linepatt.test(md); |
|||
} |
|||
|
|||
function split(text) { // Function to split lines into array
|
|||
// Function to find lines with licenses
|
|||
function licenseFilter(md) { |
|||
const linepatt = /^- `.*` - .*/; |
|||
return linepatt.test(md) |
|||
} |
|||
|
|||
// Function to split lines into array
|
|||
function split(text) { |
|||
return text.split(/\r?\n/); |
|||
} |
|||
|
|||
function findPattern(text) { // Test entries against 8 patterns. If matches pattern returns true
|
|||
const nodnospatt = /^\s{0,2}-\s\[.*?\]\(.*?\) - .{0,249}?\. `.*?` `.*?`/; // Regex for entries with no demo and no source code
|
|||
const slpatt = /^\s{0,2}-\s\[.*?\]\(.*?\) - .{0,249}?\. \(\[Demo\b\]\(.*?\), \[Source Code\b\]\(.*?\)\) `.*?` `.*?`/; // Regex for entries with demo and source code
|
|||
const nodpatt = /^\s{0,2}-\s\[.*?\]\(.*?\) - .{0,249}?\. \(\[Source Code\]\(.*?\)\) `.*?` `.*?`/; // Regex for entries with no demo
|
|||
const nospatt = /^\s{0,2}-\s\[.*?\]\(.*?\) - .{0,249}?\. \(\[Demo\]\(.*?\)\) `.*?` `.*?`/; // Regex for entries with no source code
|
|||
const pnodnospatt = /^\s{0,2}-\s\[.*?\]\(.*?\) `⚠` - .{0,249}?\. `.*?` `.*?`/; // Regex for entries with proprietary with no demo and no source code
|
|||
const pslpatt = /^\s{0,2}-\s\[.*?\]\(.*?\) `⚠` - .{0,249}?\. \(\[Demo\b\]\(.*?\), \[Source Code\b\]\(.*?\)\) `.*?` `.*?`/; // Regex for entries with proprietary with demo and source code
|
|||
const pnodpatt = /^\s{0,2}-\s\[.*?\]\(.*?\) `⚠` - .{0,249}?\. \(\[Source Code\]\(.*?\)\) `.*?` `.*?`/; // Regex for entries with proprietary with no demo
|
|||
const pnospatt = /^\s{0,2}-\s\[.*?\]\(.*?\) `⚠` - .{0,249}?\. \(\[Demo\]\(.*?\)\) `.*?` `.*?`/; // Regex for entries with proprietary with no source code
|
|||
if (nodnospatt.test(text) === true) { |
|||
return true; |
|||
} else if (slpatt.test(text) === true) { |
|||
return true; |
|||
} else if (nodpatt.test(text) === true) { |
|||
return true; |
|||
} else if (nospatt.test(text) === true) { |
|||
return true; |
|||
} else if (pnodnospatt.test(text) === true) { |
|||
return true; |
|||
} else if (pslpatt.test(text) === true) { |
|||
return true; |
|||
} else if (pnodpatt.test(text) === true) { |
|||
return true; |
|||
} else if (pnospatt.test(text) === true) { |
|||
// All entries should match this pattern. If matches pattern returns true.
|
|||
function findPattern(text) { |
|||
const patt = /^\s{0,2}-\s\[.*?\]\(.*?\) (`⚠` )?- .{0,249}?\.( \(\[(Demo|Source Code|Clients)\]\([^)\]]*\)(, \[(Source Code|Clients)\]\([^)\]]*\))?(, \[(Source Code|Clients)\]\([^)\]]*\))*\))? \`.*?\` \`.*?\`$/; |
|||
if (patt.test(text) === true) { |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
function entryErrorCheck(md) { |
|||
const namepatt = /^\s{0,2}-\s\[(.*?)\]/; // regex pattern to find name of entryArray
|
|||
const entries = split(md); // Inserts each line into the entries array
|
|||
// Parses SPDX identifiers from list of licenses
|
|||
function parseLicense(md) { |
|||
const patt = /^- `(.*)` - .*/ |
|||
return patt.exec(md)[1] |
|||
} |
|||
|
|||
//Test '- [Name](http://homepage/)'
|
|||
function testMainLink(text) { |
|||
let testA = /(^ {0,2}- \[.*?\]\([^)]*\.[^)]*?\))(?=\ ?\-?\ ?\w)/ // /(^ {0,2}- \[.*?\]\(.*\))(?=.?-? ?\w)/;
|
|||
const testA1 = /(- \W?\w*\W{0,2}.*?\)?)( .*$)/; |
|||
if (!testA.test(text)) { |
|||
let a1 = testA1.exec(text)[2]; |
|||
return chalk.red(text.replace(a1, '')) |
|||
} |
|||
return chalk.green(testA.exec(text)[1]) |
|||
} |
|||
|
|||
//Test '`⚠` - Short description, less than 250 characters.'
|
|||
function testDescription(text) { |
|||
const testB = /( - .*\. )(?:(\(?\[?|\`))/; |
|||
const testA1 = /(- \W?\w*\W{0,2}.*?\)?)( .*$)/; |
|||
const testB2 = /((\(\[|\`).*$)/; |
|||
if (!testB.test(text)) { |
|||
let b1 = testA1.exec(text)[1]; |
|||
let b2 = testB2.exec(text)[1]; |
|||
return chalk.red(text.replace(b1, '').replace(b2, '')) |
|||
} |
|||
return chalk.green(testB.exec(text)[1]) |
|||
} |
|||
|
|||
//If present, tests '([Demo](http://url.to/demo), [Source Code](http://url.of/source/code), [Clients](https://url.to/list/of/related/clients-or-apps))'
|
|||
function testSrcDemCli(text) { |
|||
let testC = text.search(/\.\ \(|\.\ \[|\ \(\[[sSdDcC]/); // /\(\[|\)\,|\)\)/);
|
|||
let testD = /(?<=\w. )(\(\[(Demo|Source Code|Clients)\]\([^)\]]*\)(, \[(Source Code|Clients)\]\([^)\]]*\))?(, \[(Source Code|Clients)\]\([^)\]]*\))*\))(?= \`?)/; |
|||
const testD1 = /(^- \W[a-zA-Z0-9-_ .]*\W{0,2}http[^\[]*)(?<= )/; |
|||
const testD2 = /(\`.*\` \`.*\`$)/; |
|||
if ((testC > -1) && (!testD.test(text))) { |
|||
let d1 = testD1.exec(text)[1]; |
|||
let d2 = testD2.exec(text)[1]; |
|||
return chalk.red(text.replace(d1, '').replace(d2, '')) |
|||
} else if (testC > -1) { |
|||
return chalk.green(testD.exec(text)[1]) |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
// Tests '`License` `Language`'
|
|||
function testLangLic(text) { |
|||
const testD2 = /(\`.*\` \`.*\`$)/; |
|||
let testE = testD2.test(text); |
|||
const testE1 = /(^[^`]*)/; |
|||
if (!testE) { |
|||
let e1 = testE1.exec(text)[1]; |
|||
return chalk.red(text.replace(e1, '')) |
|||
} |
|||
return chalk.green(testD2.exec(text)[1]) |
|||
} |
|||
|
|||
//Runs all the syntax tests...
|
|||
function findError(text) { |
|||
let res |
|||
res = testMainLink(text) |
|||
res += testDescription(text) |
|||
res += testSrcDemCli(text) |
|||
res += testLangLic(text) |
|||
return res + `\n` |
|||
} |
|||
|
|||
//Check if license is in the list of licenses.
|
|||
function testLicense(md) { |
|||
let pass = true; |
|||
let lFailed = [] |
|||
let lPassed = [] |
|||
const regex = /.*\`(.*)\` .*$/; |
|||
try { |
|||
for (l of regex.exec(md)[1].split("/")) { |
|||
if (!licenses.has(l)) { |
|||
pass = false; |
|||
lPassed.push(l) |
|||
} |
|||
lFailed.push(l) |
|||
} |
|||
} |
|||
catch(err) { |
|||
console.log(chalk.yellow("Error in License syntax, license not checked against list.")) |
|||
return [false, "", ""] |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return [pass, lFailed, lPassed] |
|||
} |
|||
|
|||
|
|||
//Parses name from entry
|
|||
function parseName(md) { |
|||
const regex = /^\W*(.*?)\W/ |
|||
return regex.exec(md)[1] |
|||
} |
|||
|
|||
function entryErrorCheck() { |
|||
const lines = split(readme); // Inserts each line into the entries array
|
|||
let totalFail = 0; |
|||
let totalPass = 0; |
|||
let total = 0; |
|||
const entryArray = []; |
|||
if (entries[0] === "") { |
|||
console.log("0 Entries") |
|||
let entries = []; |
|||
let diffEntries = []; |
|||
|
|||
if (lines[0] === "") { |
|||
console.log(chalk.red("0 Entries Found, check your commandline arguments")) |
|||
process.exit(0) |
|||
} |
|||
for (let i = 0; i < lines.length; i ++) { // Loop through array of lines
|
|||
if (entryFilter(lines[i]) === true) { // filter out lines that don't start with * [)
|
|||
e = {}; |
|||
e.raw = lines[i]; |
|||
e.line = i + 1 |
|||
entries.push(e); |
|||
} else if (licenseFilter(lines[i]) === true) { |
|||
licenses.add(parseLicense(lines[i])) |
|||
} |
|||
} |
|||
|
|||
if (pr === true) { |
|||
console.log(chalk.cyan("Only testing the diff from the PR.\n")) |
|||
const diffLines = split(diff); // Inserts each line of diff into an array
|
|||
for (let l of diffLines) { |
|||
if (entryFilter(l) === true) { // filter out lines that don't start with * [)
|
|||
e = {}; |
|||
e.raw = l; |
|||
diffEntries.push(e); |
|||
} else if (licenseFilter(l) === true) { |
|||
licenses.add(parseLicense(l)) |
|||
} |
|||
} |
|||
if (diffEntries.length === 0) { |
|||
console.log("No entries changed in README.md, Exiting...") |
|||
process.exit(0) |
|||
} |
|||
for (let i = 0, len = entries.length; i < len; i += 1) { // Loop to create array of objects
|
|||
entryArray[i] = new Object; |
|||
entryArray[i].raw = entries[i]; |
|||
if (entryFilter(entries[i]) === true) { // filter out lines that don't with * [)
|
|||
total += 1; |
|||
entryArray[i].name = namepatt.exec(entries[i])[1]; // Parses name of entry
|
|||
entryArray[i].pass = findPattern(entries[i]); // Tests against known patterns
|
|||
if (entryArray[i].pass === true) { // If entry passes increment totalPass counter
|
|||
totalPass += 1; |
|||
total = diffEntries.length |
|||
for (let e of diffEntries) { |
|||
e.pass = true |
|||
e.name = parseName(e.raw) |
|||
if (!findPattern(e.raw)) { |
|||
e.highlight = findError(e.raw); |
|||
e.pass = false; |
|||
console.log(e.highlight) |
|||
} |
|||
e.licenseTest = testLicense(e.raw); |
|||
if (!e.licenseTest) { |
|||
e.pass = false; |
|||
console.log(chalk.red(`${e.name}'s license is not on License list.`)) |
|||
} |
|||
if (e.pass) { |
|||
totalPass++ |
|||
} else { |
|||
console.log(`${entryArray[i].name} Failed.`); // If entry fails increment totalFail counter and append error to issuelog
|
|||
// entryArray[i].error = findError(entries[i]) //WIP
|
|||
totalFail += 1; |
|||
issuelog += `${entryArray[i].name} | ${entries[i]} \\n`; |
|||
fails += `${entries[i]} \n\n`; |
|||
totalFail++ |
|||
} |
|||
} |
|||
} else { |
|||
console.log(chalk.cyan("Testing entire README.md\n")) |
|||
total = entries.length |
|||
for (let e of entries) { |
|||
e.pass = true |
|||
e.name = parseName(e.raw) |
|||
if (!findPattern(e.raw)) { |
|||
e.highlight = findError(e.raw); |
|||
e.pass = false; |
|||
console.log(`${chalk.yellow(e.line + ": ")}${e.highlight}`); |
|||
syntax = e.highlight; |
|||
} |
|||
if (totalFail > 0) { // Logs # passed & failed to console, and failures to syntaxcheck.json
|
|||
console.log(`${totalFail} Failed, ${totalPass} Passed, of ${total}\n-----------------------------`); |
|||
console.log(fails) |
|||
log += ` "error": true,\n "title": "Found ${totalFail} entries with syntax error(s).",\n`; |
|||
fs.writeFileSync('syntaxcheck.json', `${log} ${issuelog} "\n}`); |
|||
e.licenseTest = testLicense(e.raw); |
|||
if (!e.licenseTest[0]) { |
|||
e.pass = false; |
|||
console.log(chalk.yellow(e.line + ": ") + `${e.name}'s license ${chalk.red(`'${e.licenseTest[1]}'`)} is not on the License list.\n`) |
|||
} |
|||
if (e.pass) { |
|||
totalPass++ |
|||
} else { |
|||
totalFail++ |
|||
} |
|||
} |
|||
} |
|||
if (totalFail > 0) { |
|||
console.log(chalk.blue(`\n-----------------------------\n`)) |
|||
console.log(chalk.red(`${totalFail} Failed, `) + chalk.green(`${totalPass} Passed, `) + chalk.blue(`of ${total}`)) |
|||
console.log(chalk.blue(`\n-----------------------------\n`)) |
|||
process.exit(1); |
|||
} else { // Logs # of entries passed to console and error: false to syntaxcheck.json
|
|||
console.log(`${totalFail} Failed, ${totalPass} Passed, of ${total} \n`); |
|||
log += ' "error": false\n}'; |
|||
fs.writeFileSync('syntaxcheck.json', log); |
|||
process.exit(0); |
|||
} else { |
|||
console.log(chalk.blue(`\n-----------------------------\n`)) |
|||
console.log(chalk.green(`${totalPass} Passed of ${total}`)) |
|||
console.log(chalk.blue(`\n-----------------------------\n`)) |
|||
process.exit(0) |
|||
} |
|||
} |
|||
|
|||
entryErrorCheck(file); |
|||
parseArgs(process.argv) |
|||
entryErrorCheck(); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue