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

Implement TodoByVersionRule #12

Closed staabm closed 9 months ago

staabm commented 9 months ago

Reference version

By default version-todo-comments are checked against "nextMajor" version. This is determined by fetching the latest local available git tag and incrementing the major version number.

This behaviour can be configured with the referenceVersion option. Possible values are "nextMajor", "nextMinor", "nextPatch" - which will be computed based on the latest local git tag - or any other version string like "1.2.3".

parameters:
    todo_by:
        # "nextMajor", "nextMinor", "nextPatch" or a version string like "1.2.3"
        referenceVersion: "nextMinor"

Make sure tags are available within your git clone, e.g. by running git fetch --tags origin.

In a GitHub Action this can be done like this:

    -   name: Checkout
        uses: actions/checkout@v4

    -   name: Get tags
        run: git fetch --tags origin

closes https://github.com/staabm/phpstan-todo-by/issues/6