Skip to content

Commit

Permalink
Check markdown images; check manifest project filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
RobH123 committed Nov 25, 2020
1 parent 0c14e16 commit 5a8adcc
Show file tree
Hide file tree
Showing 39 changed files with 357 additions and 210 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Most of the high-level demonstrations allow a choice of one of three display for
In addition, there are some options in the display of notices for the demonstrations, set in `optionalProcessingOptions` used by the sample notice processing functions:

- ignorePriorityNumberList: a list (array) of integers that causes of notices with these priority values to be dropped during notice processing
- sortBy: a string which can be set to 'ByPriority'—the default is 'AsFound', i.e., unsorted
- sortBy: a string which can be set to 'ByPriority', 'ByRepo', or 'AsFound'—the default is 'ByPriority', i.e., unsorted
- errorPriorityLevel: an integer which can define *errors* (vs *warnings*) (if relevant)—defaults to 700 (and above)
- severePriorityLevel: an integer which can define *severe* errors (if relevant)—defaults to 800 (and above)
- mediumPriorityLevel: an integer which can define *medium* errors (if relevant)—defaults to 600 (and up to `severePriorityLevel`)
Expand Down
22 changes: 13 additions & 9 deletions noticeList.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Last updated 2020-11-23 13:45:17.695847 by makeNoticeList.py
Got 294 notices:
Last updated 2020-11-25 09:40:53.304909 by makeNoticeList.py
Got 298 notices:
checkRepoResult.noticeList.push( 997, "Repository doesn't exist", details, username, repoCode, repoName, location: givenLocation, extra: repoCode from checkRepo.js line 243
languageCode === 'en' || languageCode === 'fr' ? 490 : 190, "Expected header field to contain a mixed-case string", fieldName: `\\$marker`, extract: rest, C, V, location: lineLocation from usfm-text-check.js line 729
marker === 's5' ? 111 : 809, `$marker === 's5' ? 'Deprecated' : 'Unexpected' '\\$marker' marker at start of line`, C, V, lineNumber, characterIndex: 1, location: lineLocation from usfm-text-check.js line 752
Expand All @@ -19,7 +19,7 @@ Got 294 notices:
notice from field-text-check.js line 296
const notice = 193, `Unexpected $punctChar character at end of line`, extract, location: ourLocation ; from field-text-check.js line 309
notice from field-text-check.js line 311
leftChar === '“' ? 163 : 563, `Mismatched $leftChar$rightChar characters`, details: `(left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString())`, location: ourLocation from field-text-check.js line 340
leftChar === '“' ? 163 : 563, `Mismatched $leftChar$rightChar characters`, details: `(left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString())`, location: ourLocation from field-text-check.js line 347
leftChar === '“' ? 162 : 462, `Mismatched $leftChar$rightChar characters`, details: `(left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString())`, location: ourLocation from plain-text-check.js line 216
999, "checkRepo function FAILED", repoName, extract: checkRepoError, location: repoName from RepoCheck.js line 103
997, "Repository doesn't exist", details, username, repoCode, repoName, location: manifestLocation, extra: repoCode from checkBookPackage.js line 168
Expand All @@ -46,7 +46,7 @@ Got 294 notices:
988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_ANNOTATION_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 227
987, C, V, "Expected \\id line to start with book identifier", lineNumber: n, characterIndex: 4, extract, location: ourLocation from usfm-text-check.js line 908
986, "Repository doesn't seem to exist", details: `username=$username`, location: givenLocation, extra: repoName from checkRepo.js line 150
985, `Field does not match schema $errorObject.keyword`, details: errorObject.message, fieldName: errorObject.dataPath, location: ourLocation from manifest-text-check.js line 656
985, `Field does not match schema $errorObject.keyword`, details: errorObject.message, fieldName: errorObject.dataPath, location: ourLocation from manifest-text-check.js line 670
984, `Found wrong number of TSV fields (expected $NUM_EXPECTED_TN_TSV_FIELDS)`, details: `Found $fields.length field$fields.length === 1 ? '' : 's'`, rowID, location: ourRowLocation from tn-table-row-check.js line 523
984, `Found wrong number of TSV fields (expected $NUM_EXPECTED_ANNOTATION_TSV_FIELDS)`, details: `Found $fields.length field$fields.length === 1 ? '' : 's'`, rowID, location: ourRowLocation from annotation-row-check.js line 528
979, "Invalid book identifier passed to checkTN_TSVDataRow", location: ` '$bookID' in first parameter: $tlcNCerror` from tn-table-row-check.js line 326
Expand All @@ -64,8 +64,12 @@ Got 294 notices:
944, `USFM3 Grammar Check ($strictnessString mode) doesn't pass`, filename, location: ourLocation from BCS-usfm-grammar-check.js line 177
943, `USFM3 toJSON Check doesn't pass`, location: ourLocation from usfm-js-check.js line 90
942, "USFM Grammar check fails", location from usfm-text-check.js line 957
929, "'projects' key is missing", location: ourLocation from manifest-text-check.js line 621
928, "'dublin_core' key is missing", location: ourLocation from manifest-text-check.js line 619
939, "Key is missing for project", details: keyName, extract: JSON.stringify(projectEntry), location: ourLocation from manifest-text-check.js line 682
938, `Unable to find project file mentioned in manifest`, extract: projectFilepath, location: ourLocation from manifest-text-check.js line 692
937, `Linked project file seems empty`, extract: projectFilepath, location: ourLocation from manifest-text-check.js line 694
936, `Error loading manifest project link`, details: trcGCerror, extract: projectFilepath, location: ourLocation from manifest-text-check.js line 696
929, "'projects' key is missing", location: ourLocation from manifest-text-check.js line 635
928, "'dublin_core' key is missing", location: ourLocation from manifest-text-check.js line 633
920, yamlError.message, location: ourLocation ) from yaml-text-check.js line 158
919, "Missing OrigQuote field", fieldName: 'OrigQuote', rowID, location: ourRowLocation from tn-table-row-check.js line 453
919, "Missing Quote field", fieldName: 'Quote', rowID, location: ourRowLocation from annotation-row-check.js line 469
Expand Down Expand Up @@ -100,7 +104,7 @@ Got 294 notices:
867, C: chapterNumberString, V: `$v`, "Verse appears to be missing", location: CVlocation from usfm-text-check.js line 428
866, C: chapterNumberString, V: `$v`, "Verse seems to have no text", location: CVlocation from usfm-text-check.js line 433
851, bookID === 'OBS' ? "Unable to load OBS story text" : "Unable to load original language verse text", location: ourLocation from orig-quote-check.js line 276
849, "Unexpected \\[ or \\] characters", characterIndex, extract, location: ourLocation from field-text-check.js line 320
849, `Unexpected '$badCharCombination' character combination`, characterIndex, extract, location: ourLocation from field-text-check.js line 319
845, `Mismatched [[ ]] link characters`, details: `(left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString())`, location: ourLocation from tn-links-check.js line 460
844, `Mismatched [[rc:// ]] link characters`, details: `(left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString())`, location: ourLocation from tn-links-check.js line 464
843, `Mismatched [ ]( ) link characters`, details: `(left=$leftCount.toLocaleString(), middle=$middleCount.toLocaleString(), right=$rightCount.toLocaleString())`, location: ourLocation from tn-links-check.js line 471
Expand Down Expand Up @@ -153,7 +157,7 @@ Got 294 notices:
770, `Unexpected leading word joiner`, characterIndex: 0, extract, location: ourLocation from field-text-check.js line 134
769, C, V, "Verse bridge numbers not in ascending order", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, Math.max(9, extractLength))$rest.length > extractLength ? '…' : '' ($firstV → $secondV)`, location: ourLocation from usfm-text-check.js line 884
766, C, V, "Bridged verse numbers didn't increment correctly", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, Math.max(9, extractLength))$rest.length > extractLength ? '…' : '' ($lastV → $firstV)`, location: ourLocation from usfm-text-check.js line 886
765, "Unexpected link", characterIndex, extract, location: ourLocation from field-text-check.js line 355
765, "Unexpected link", characterIndex, extract, location: ourLocation from field-text-check.js line 362
764, C, V, "Chapter number didn't increment correctly", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, halfLength)$rest.length > halfLength ? '…' : '' ($lastC ? lastC : '0' → $C)`, location: ourLocation from usfm-text-check.js line 857
763, C, V, "Verse number didn't increment correctly", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, halfLength)$rest.length > halfLength ? '…' : '' ($lastV ? lastV : '0' → $V)`, location: ourLocation from usfm-text-check.js line 870
762, "Unable to convert verse bridge numbers to integers", C: chapterNumberString, V: verseNumberString, characterIndex: 3, extract: verseNumberString, location: `$CVlocation with $usfmVIerror` from usfm-text-check.js line 402
Expand Down Expand Up @@ -272,7 +276,7 @@ Got 294 notices:
158, "Unexpected space(s) beside ellipse character", characterIndex, extract, location: ourLocation from orig-quote-check.js line 246
157, "Unexpected space(s) beside ↔ divider character", characterIndex, extract, location: ourLocation from orig-quote-check.js line 253
156, "Unexpected space(s) beside ellipse characters", characterIndex, extract, location: ourLocation from orig-quote-check.js line 260
148, "'checking' key is missing", location: ourLocation from manifest-text-check.js line 623
148, "'checking' key is missing", location: ourLocation from manifest-text-check.js line 637
143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 306
143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 358
143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 410
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uw-content-validation",
"description": "Functions for Checking Door43.org Scriptural Content/Resources.",
"version": "0.9.2_alpha1",
"version": "0.9.2",
"private": false,
"homepage": "https://unfoldingword.github.io/uw-content-validation/",
"repository": {
Expand Down
51 changes: 19 additions & 32 deletions src/__tests__/__snapshots__/book-package-check.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6828,22 +6828,6 @@ Object {
"repoName": "en_tq",
"username": "unfoldingWord",
},
Object {
"C": "1",
"V": "20",
"bookID": "RUT",
"characterIndex": 116,
"extra": "TQ",
"extract": "…with␣her.␣",
"filename": "rut/01/20.md",
"lineNumber": 3,
"location": " in unfoldingWord (master)",
"message": "Unexpected trailing space(s)",
"priority": 95,
"repoCode": "TQ",
"repoName": "en_tq",
"username": "unfoldingWord",
},
Object {
"C": "1",
"V": "20",
Expand Down Expand Up @@ -6874,21 +6858,6 @@ Object {
"repoName": "en_tq",
"username": "unfoldingWord",
},
Object {
"C": "3",
"V": "9",
"bookID": "RUT",
"details": "(left=0, right=1)",
"extra": "TQ",
"filename": "rut/03/09.md",
"lineNumber": 3,
"location": " in unfoldingWord (master)",
"message": "Mismatched “” characters",
"priority": 163,
"repoCode": "TQ",
"repoName": "en_tq",
"username": "unfoldingWord",
},
Object {
"C": "3",
"V": "9",
Expand Down Expand Up @@ -19633,7 +19602,25 @@ Object {
"filename": "en_tn_57-TIT.tsv",
"lineNumber": 41,
"location": " in en TIT book package from unfoldingWord master branch",
"message": "Unexpected \\\\[ or \\\\] characters",
"message": "Unexpected '\\\\[' character combination",
"priority": 849,
"repoCode": "TN",
"repoName": "en_tn",
"rowID": "abcj",
"username": "unfoldingWord",
},
Object {
"C": "1",
"V": "9",
"bookID": "TIT",
"characterIndex": 359,
"extra": "TN",
"extract": "…ic-goal\\\\]\\\\])",
"fieldName": "OccurrenceNote",
"filename": "en_tn_57-TIT.tsv",
"lineNumber": 41,
"location": " in en TIT book package from unfoldingWord master branch",
"message": "Unexpected '\\\\]' character combination",
"priority": 849,
"repoCode": "TN",
"repoName": "en_tn",
Expand Down
4 changes: 2 additions & 2 deletions src/core/annotation-row-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ function CheckAnnotationRow(props) {
(async () => {
// Display our "waiting" message
setResults(<p style={{ color: 'magenta' }}>Checking {tableLineName} <b>{bookID}</b></p>);
// (Final unused parameter is optionalCheckingOptions)
const rawResults = await checkAnnotationTSVDataRow(languageCode, annotationType, tableLine, bookID, C, V, givenLocation, {});
const optionalCheckingOptions = {};
const rawResults = await checkAnnotationTSVDataRow(languageCode, annotationType, tableLine, bookID, C, V, givenLocation, optionalCheckingOptions);
setResults(
<div>
<b>Check</b> {tableLineName}: "{tableLine.substr(0,256)}…"<br/><br/>
Expand Down
4 changes: 2 additions & 2 deletions src/core/annotation-table-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function CheckAnnotationRows(props) {
(async () => {
// Display our "waiting" message
setResults(<p style={{ color: 'magenta' }}>Checking {languageCode} {annotationType} for {tableTextName} <b>{bookID}</b></p>);
// (Final unused parameter is optionalCheckingOptions)
const rawResults = await checkAnnotationRows(languageCode, annotationType, bookID, filename, tableText, givenLocation, {});
const optionalCheckingOptions = {};
const rawResults = await checkAnnotationRows(languageCode, annotationType, bookID, filename, tableText, givenLocation, optionalCheckingOptions);
setResults(
<div>
<b>Check</b> {tableTextName}: "{tableText.substr(0,256)}…"<br/><br/>
Expand Down
2 changes: 1 addition & 1 deletion src/core/books/books.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const BibleBookData = { "gen": {"id": "gen", "title": "Genesis", "usfm": "01-GEN
"ecc": {"id": "ecc", "title": "Ecclesiastes", "usfm": "21-ECC", "testament": "old", "verseCount": 222, "chapters": [18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14]},
"sng": {"id": "sng", "title": "Song of Songs", "usfm": "22-SNG", "testament": "old", "verseCount": 117, "chapters": [17, 17, 11, 16, 16, 13, 13, 14]},
"isa": {"id": "isa", "title": "Isaiah", "usfm": "23-ISA", "testament": "old", "verseCount": 1292, "chapters": [31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 12, 25, 24]},
"jer": {"id": "jer", "title": "Jermiah", "usfm": "24-JER", "testament": "old", "verseCount": 1364, "chapters": [19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34]},
"jer": {"id": "jer", "title": "Jeremiah", "usfm": "24-JER", "testament": "old", "verseCount": 1364, "chapters": [19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34]},
"lam": {"id": "lam", "title": "Lamentations", "usfm": "25-LAM", "testament": "old", "verseCount": 154, "chapters": [22, 22, 66, 22, 22]},
"ezk": {"id": "ezk", "title": "Ezekiel", "usfm": "26-EZK", "testament": "old", "verseCount": 1273, "chapters": [28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35]},
"dan": {"id": "dan", "title": "Daniel", "usfm": "27-DAN", "testament": "old", "verseCount": 357, "chapters": [21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13]},
Expand Down
4 changes: 2 additions & 2 deletions src/core/field-link-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export async function startLiveLinksCheck(linksList, existingNoticeList, callbac
console.log("startLiveLinksCheck attempting to fetch", fetchLink, '…');
try {
const responseData = await cachedGetFileUsingFullURL(fetchLink);
const responseText = responseData.text();
console.log("startLiveLinksCheck got response: ", responseText.length, responseText);
const responseText = responseData;
console.log("startLiveLinksCheck got response: ", responseText.length);
} catch (lcError) {
console.error(`startLiveLinksCheck had an error fetching '${fetchLink}': ${lcError}`);
addNoticePartial({ priority: 439, message: "Error fetching link", location: ` ${fetchLink}` });
Expand Down
Loading

0 comments on commit 5a8adcc

Please sign in to comment.