Skip to content

Commit

Permalink
Extract PHP warning messages from log
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Mar 20, 2024
1 parent 0fcb467 commit 773b45d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
python ${LOG_TO_CS} ${RAW_LOG} ${CS_XML}
- name: Convert Raw Log to Checkstyle format (launch action)
uses: mdeweerd/logToCheckStyle@v2024.3.2
uses: mdeweerd/logToCheckStyle@v2024.3.3
if: ${{ failure() }}
with:
in: ${{ env.RAW_LOG }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ optional arguments:
```yaml
- name: Convert Raw Log to Checkstyle format (launch action)
uses: mdeweerd/logToCheckStyle@v2024.3.2
uses: mdeweerd/logToCheckStyle@v2024.3.3
if: ${{ failure() }}
with:
in: ${{ env.RAW_LOG }}
Expand Down
2 changes: 1 addition & 1 deletion logToCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def submit( # pylint: disable=too-many-arguments
# Or:
# Fatal error: Message in path/to/file on line 91
re.compile(
rf"^(?:PHP )Fatal error:{MSG_REGEX}"
rf"^(?:PHP )(Fatal )?{SEVERITY_REGEX}:{MSG_REGEX}"
rf" in {FILE_REGEX} on line {LINE_REGEX}$"
),
]
Expand Down
1 change: 1 addition & 0 deletions tests/IN/phpunit_phpwarning.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PHP Warning: file_exists(): open_basedir restriction in effect. File(../includes/nusoap/lib/class.*) is not within the allowed path(s): (D:\path\htdocs;D:\path\documents;D:\path\test;D:\path\dev;c:\tools\php) in D:\path\htdocs\install\upgrade2.php on line 4135
1 change: 1 addition & 0 deletions tests/IN/phpunit_phpwarning.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::warning file=D%3A/path/htdocs/install/upgrade2.php,line=4135::file_exists(): open_basedir restriction in effect. File(../includes/nusoap/lib/class.*) is not within the allowed path(s): (D:\path\htdocs;D:\path\documents;D:\path\test;D:\path\dev;c:\tools\php)
2 changes: 2 additions & 0 deletions tests/IN/phpunit_phpwarning.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='utf_8'?>
<checkstyle version="6.5"><file name="D:\path\htdocs\install\upgrade2.php"><error severity="warning" line="4135" message="file_exists(): open_basedir restriction in effect. File(../includes/nusoap/lib/class.*) is not within the allowed path(s): (D:\path\htdocs;D:\path\documents;D:\path\test;D:\path\dev;c:\tools\php)" /></file></checkstyle>

0 comments on commit 773b45d

Please sign in to comment.