staabm / phpstan-todo-by

Todo comments with expiration
https://staabm.github.io/2023/12/17/phpstan-todo-by-published.html
MIT License
173 stars 4 forks source link

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

Closed ZebulanStanphill closed 9 months ago

ZebulanStanphill commented 9 months ago

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.

staabm commented 9 months ago

Thx for reporting.

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

staabm commented 9 months ago

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

ZebulanStanphill commented 8 months ago

Thanks!

jeslopcru commented 8 months ago

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.

staabm commented 8 months ago

@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

github-actions[bot] commented 7 months ago

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.