staabm/phpstan-todo-by

Regression: 0.1.7 crashes when current Git project has no tags, even if no todo comments reference a version

Closed this issue · 6 comments

Version 0.1.6 worked fine on my project, but after updating to 0.1.7, tons of errors in the following format are produced when running PHPStan analysis:

Internal error: Internal error: Could not determine latest git tag while analysing file <MyFileName>

This seems to be caused by my project having no Git tags. Notably, I don't even have any todo comments that reference a version number.

Thx for reporting.

Could identify wether its related to a certain comment? A reproducer would be great

I was able to reproduce it. published a fix with https://github.com/staabm/phpstan-todo-by/releases/tag/0.1.8

I have the same issue when I try to update to 0.1.13:

This error appears in dependabot's PR Bump staabm/phpstan-todo-by from 0.1.10 to 0.1.13

Note: Using configuration file /home/runner/work/phone-app/phone-app/phpstan.neon.
?:?:Internal error: Internal error: Could not determine latest git tag while analysing file /home/run.....

I tried to update manually and I have the same error.
I'm using docker to execute phpstan.

@jeslopcru I just pushed a new release which turns this internal error into a regular phpstan error, so at least it doesn't fail the whole scan.

I also added a FAQ into the readme which should point you to the doc chapter which gives you an idea about the underlying problem: https://github.com/staabm/phpstan-todo-by#could-not-determine-latest-git-tag-error

spoiler: the problem pretty likely is, that your git clone has not yet fetched git tags

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.