-
-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Optimize Sanitiser schema merging #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "runs": [ | ||
| { | ||
| "results": [ | ||
| { | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "region": { | ||
| "startLine": 0, | ||
| "startColumn": 0, | ||
| "endLine": 0, | ||
| "endColumn": 0 | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "physicalLocation": { | ||
| "region": { | ||
| "startLine": 10, | ||
| "startColumn": 5, | ||
| "endLine": 10, | ||
| "endColumn": 15 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Psalm has detected issues in your platform: | ||
|
|
||
| Psalm requires a PHP version ">= 8.3.16". You are running 8.3.6. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Psalm has detected issues in your platform: | ||
|
|
||
| Psalm requires a PHP version ">= 8.3.16". You are running 8.3.6. | ||
|
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove accidentally committed runtime artifact. This file appears to be actual Psalm stderr output captured during development/debugging, not a test fixture. It should not be committed to the repository as it:
Additionally, this reveals that the CI environment's PHP version (8.3.6) doesn't meet Psalm's requirement (>= 8.3.16), which may affect analysis accuracy. Consider adding this file to env:
- PHP_VERSION: '8.3'
+ PHP_VERSION: '8.3.16'🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "runs": [ | ||
| { | ||
| "results": [ | ||
| { | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "region": { | ||
| "startLine": 0, | ||
| "startColumn": 0, | ||
| "endLine": 0, | ||
| "endColumn": 0 | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "physicalLocation": { | ||
| "region": { | ||
| "startLine": 10, | ||
| "startColumn": 5, | ||
| "endLine": 10, | ||
| "endColumn": 15 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "runs": [ | ||
| { | ||
| "results": [ | ||
| { | ||
| "locations": [ | ||
| { | ||
| "physicalLocation": { | ||
| "region": { | ||
| "startLine": 1, | ||
| "startColumn": 1, | ||
| "endLine": 1, | ||
| "endColumn": 1 | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "physicalLocation": { | ||
| "region": { | ||
| "startLine": 10, | ||
| "startColumn": 5, | ||
| "endLine": 10, | ||
| "endColumn": 15 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for the SARIF normalization step.
The
jqcommand correctly normalizes invalid SARIF locations, but lacks error handling. Ifjqfails (e.g., malformed JSON from Psalm), themvwill overwritepsalm.sarifwith an empty or corrupt file.Proposed fix with error handling
# Fix invalid SARIF generated by Psalm (locations with 0) if [ -f psalm.sarif ]; then - jq 'walk(if type == "object" and .region? then .region |= with_entries(if (.key | test("Line|Column")) and .value < 1 then .value = 1 else . end) else . end)' psalm.sarif > psalm.sarif.tmp && mv psalm.sarif.tmp psalm.sarif + if jq 'walk(if type == "object" and .region? then .region |= with_entries(if (.key | test("Line|Column")) and .value < 1 then .value = 1 else . end) else . end)' psalm.sarif > psalm.sarif.tmp; then + mv psalm.sarif.tmp psalm.sarif + else + echo "Warning: Failed to normalize SARIF, using original" + rm -f psalm.sarif.tmp + fi fi🤖 Prompt for AI Agents