-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid duplicated reports (also fix CI)
- Loading branch information
André L F S Bacci
committed
Dec 6, 2024
1 parent
a153861
commit ddbe0d3
Showing
1 changed file
with
19 additions
and
7 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 |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
| Authors: Dave Barr <[email protected]> | | ||
| Hannes Magnusson <[email protected]> | | ||
| Gwynne Raskind <[email protected]> | | ||
| André L F S Bacci <[email protected]> | | ||
+----------------------------------------------------------------------+ | ||
*/ | ||
|
||
|
@@ -780,17 +781,20 @@ function dom_saveload( DOMDocument $dom , string $filename ) | |
|
||
echo "Loading and parsing {$ac["INPUT_FILENAME"]}... "; | ||
|
||
if ( ! dom_load( $dom , "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}" ) ) | ||
if ( dom_load( $dom , "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}" ) ) | ||
{ | ||
echo "failed.\n"; | ||
print_xml_errors(); | ||
errors_are_bad(1); | ||
if ( ! file_exists( __DIR__ . "/temp" ) ) | ||
mkdir( __DIR__ . "/temp" , true ); //TODO remove after #200, aldo clean up flush(), header | ||
|
||
// Correct file/line/column on error messages | ||
dom_saveload( $dom , __DIR__ . "/temp/manual.xml" ); | ||
echo "done.\n"; | ||
} | ||
else | ||
{ | ||
// So that file/line/column makes sense on error messages | ||
dom_saveload( $dom , __DIR__ . "/temp/manual.xml" ); | ||
echo "done.\n"; | ||
echo "failed.\n"; | ||
print_xml_errors(); | ||
errors_are_bad(1); | ||
} | ||
|
||
echo "Running XInclude/XPointer... "; | ||
|
@@ -893,13 +897,21 @@ function xinclude_report() | |
$count = 0; | ||
$prefix = realpath( __DIR__ ); | ||
|
||
$prevLine = -1; | ||
$prevClmn = -1; | ||
|
||
foreach( $errors as $error ) | ||
{ | ||
$msg = $error->message; | ||
$file = $error->file; | ||
$line = $error->line; | ||
$clmn = $error->column; | ||
|
||
if ( $prevLine == $line && $prevClmn == $clmn ) | ||
continue; // XPointer failures double reports sometimes | ||
$prevLine = $line; | ||
$prevClmn = $clmn; | ||
|
||
$msg = rtrim( $msg ); | ||
if ( str_starts_with( $file , $prefix ) ) | ||
$file = substr( $file , strlen( $prefix ) + 1 ); | ||
|