Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for .vue files #145
Add support for .vue files #145
Changes from 10 commits
301194f
1cfa197
d2543a3
1f824e5
f1c46db
16518d4
448c1e8
5bf67b0
6ce5593
2d9012e
c60e0bc
5d440d8
c232629
0255c47
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the location of this line
0
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is weird. I mean, you are right, but I get an error if I implement it like you proposed:
` No matching todo detected in any of the scenarios
And here, the displayed line of the actual todo is zero. I'm confused. Do you have any idea why it behaves that way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually is a bug with the comment matcher implementation.
There are two issues:
/* some todo comment */
, but instead you are matchingsome todo comment */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try reproducing this by:
go build todocheck
and copying the output binary to a comfortable locationmain.vue
which contains the scenario from the test.todocheck.yaml
file with contents:./todocheck
& verify the resultsYou can try instrumenting some debug prints to see what's going on or use a standard debugger if you have one set up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, you were right, it was indeed a bug. I think the new commits I pushed fix it. At least, now all the testing works as expected. I also added another test for an invalid HTML multiline TODO, which also works.
But there is one other thing I noticed, and I am not sure if its a feature or a bug: The last line of every file is always ignored, also by other file matchers (checked PHP briefly). This means that multiline comments that are closed in the last line are not checked for errors (since they technically never become closed).
If this is indeed a feature, I'd be interested in an explanation for it. Maybe it would then be helpful to throw an error if the last line is not empty, since it could lead to missing TODOs otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The final testcase you've added:
proves it otherwise. What exactly do you mean?
If your observation is indeed correct, then this is a bug. If you can reproduce it deterministically, could you open a bug with reproduction steps & share the details?