Skip to content
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

Get an error for a TODO without an expiration constraint #87

Open
Deuchnord opened this issue Feb 12, 2024 · 5 comments
Open

Get an error for a TODO without an expiration constraint #87

Deuchnord opened this issue Feb 12, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Deuchnord
Copy link

Hello, great package!

I may have not searched correctly, but is there a way to get PhpStan fail with an error if a TODO exists without an expiration constraint?

For instance, if I write:

// TODO: write tests

I'd like to configure phpstan-todo-by in a way it will reject my TODO until I set a condition.

Is it possible?

@staabm staabm added the enhancement New feature or request label Feb 12, 2024
@staabm
Copy link
Owner

staabm commented Feb 12, 2024

hey,

its not yet possible. I think it would be a good idea though to optionally report invalid TODO comments.

@staabm staabm added help wanted Extra attention is needed good first issue Good for newcomers labels Feb 12, 2024
@staabm
Copy link
Owner

staabm commented May 24, 2024

hmm thinking again about it.. most comments usually not have a expiration and forcing people to write a expiration condition sounds like a frustrating experience

@staabm staabm closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
@Deuchnord
Copy link
Author

hmm thinking again about it.. most comments usually not have a expiration and forcing people to write a expiration condition sounds like a frustrating experience

Why not making this an option disabled by default, to prevent it to break PhpStan if this behavior is not wanted?

@staabm
Copy link
Owner

staabm commented May 26, 2024

to prevent it to break PhpStan if this behavior is not wanted?

could you elaborate on how this "breaks phpstan"?

Why not making this an option disabled by default

I can think of a project in which you really want a expire condition on every comment in the codebase. this sounds like a hurdle which might prevent people from commenting stuff at all

@gharlan
Copy link

gharlan commented May 26, 2024

I can think of a project in which you really want a expire condition on every comment in the codebase.

Not on every comment, but on every todo comment (@todo etc.).
While working on bigger features I often use temporary todo comments which should be fixed before merging into main. So in my main branch all todo comments should have an expiration.

@staabm staabm reopened this May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants