Skip to content

Commit 2a47f4d

Browse files
committed
✨ Add support for hurl error format parsing
Added new regex pattern to parse hurl error messages. The new format is: error: Error message --> api/contracts/10_contracts.hurl:3:6 Also added test files for hurl error parsing: - hurl.log: Sample hurl error log - hurl.txt: Error messages in GitHub Actions format - hurl.xml: Error messages in Checkstyle format
1 parent 3021f50 commit 2a47f4d

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: |
3838
python ${LOG_TO_CS} ${RAW_LOG} ${CS_XML}
3939
- name: Convert Raw Log to Checkstyle format (launch action)
40-
uses: mdeweerd/logToCheckStyle@v2025.1.1
40+
uses: mdeweerd/logToCheckStyle@v2025.11.1
4141
if: ${{ failure() }}
4242
with:
4343
in: ${{ env.RAW_LOG }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ optional arguments:
5050
5151
```yaml
5252
- name: Convert Raw Log to Checkstyle format (launch action)
53-
uses: mdeweerd/logToCheckStyle@v2025.1.1
53+
uses: mdeweerd/logToCheckStyle@v2025.11.1
5454
if: ${{ failure() }}
5555
with:
5656
in: ${{ env.RAW_LOG }}

logToCs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ def submit( # pylint: disable=too-many-arguments
419419
f"^{FILE_REGEX}{EOL_REGEX}"
420420
rf"\s+{LINE_REGEX}:{COLUMN_REGEX}\s+{SEVERITY_REGEX}\s+{MSG_REGEX}$"
421421
),
422+
# hurl:
423+
# error: Error message
424+
# --> api/contracts/10_contracts.hurl:3:6
425+
re.compile(
426+
f"^error: {MSG_REGEX}{EOL_REGEX}"
427+
rf"\s+--> {FILE_REGEX}:{LINE_REGEX}:{COLUMN_REGEX}$"
428+
),
422429
# Phan:
423430
# path\to\file.php:379 PhanKey Message...
424431
re.compile(f"^{FILE_REGEX}:{LINE_REGEX} {MSG_REGEX}$"),

tests/IN/hurl.log

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
error: Assert status code
3+
--> api/status/10_status.hurl:3:6
4+
|
5+
| GET http://{{hostnport}}/api/index.php/status
6+
3 | HTTP 200
7+
| ^^^ actual value is <401>
8+
|
9+
10+
Failure api/status/10_status.hurl (1 request(s) in 75 ms)
11+
error: Assert status code
12+
--> api/emailtemplates/10_emailtemplates.hurl:3:6
13+
|
14+
| GET http://{{hostnport}}/api/index.php/emailtemplates
15+
3 | HTTP 200
16+
| ^^^ actual value is <401>
17+
|

tests/IN/hurl.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
::error file=api/status/10_status.hurl,line=3,col=6::Assert status code
2+
::error file=api/emailtemplates/10_emailtemplates.hurl,line=3,col=6::Assert status code

tests/IN/hurl.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='utf_8'?>
2+
<checkstyle version="6.5"><file name="api/status/10_status.hurl"><error severity="error" line="3" column="6" message="Assert status code" /></file><file name="api/emailtemplates/10_emailtemplates.hurl"><error severity="error" line="3" column="6" message="Assert status code" /></file></checkstyle>

0 commit comments

Comments
 (0)