Skip to content

Conversation

@bartlangelaan
Copy link

In Gitlab, the MR widget was always showing "No changes to code quality". One of the errors was printed like this:

[
    {
        "description": "Class [...] not found.",
        "fingerprint": "17c1f3ebd05edb28bfbd26b74f917f92fe1c906762ed4fd764375f6f65c30ce3",
        "severity": "blocker",
        "location": {
            "path": "[...].php",
            "lines": {
                "begin": null
            }
        }
    }
]

After searching for a while, I found this on the Gitlab docs:

If your merge requests do not show any code quality changes when using a custom tool, ensure that the line property is an integer.

After fixing this single error, the errors suddenly showed up.

This MR makes sure that the line property is not null.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Maybe line 1 would be better?
  2. This change needs a test.

@bartlangelaan
Copy link
Author

  1. Line 0 is in parity with 'not file specific errors', they are already reported as line 0.
  2. I agree, but I'm not very familiar with phpstan development. I just created this commit through the gitlab UI - is this something you can pick up?

@ondrejmirtes
Copy link
Member

Superseded by #616.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants