alstr / todo-to-issue-action

Action that converts TODO comments to GitHub issues on push.
MIT License
603 stars 115 forks source link

Action ran fine, but didn't pick TSX comments? #160

Closed netpoe closed 2 months ago

netpoe commented 1 year ago

So, .tsx extension is listed in the languages.yml file, this is my TODO comment:

{/*
  @TODO complete the FAQs
  labels: 100 USDT
*/}

I already added the IDENTIFIERS prop the workflow file:

name: "Run TODO to Issue"
on: ["push"]
jobs:
    build:
        runs-on: "ubuntu-latest"
        steps:
            - uses: "actions/checkout@v3"
            - name: "TODO to Issue"
              uses: "alstr/todo-to-issue-action@v4"
              with:
                IDENTIFIERS: '[{"name": "@TODO", "labels": ["help wanted"]}]'

Didn't pick the @TODO comment after pushing the file, but the action ran without errors.

Does the comment is formatted incorrectly?

alstr commented 1 year ago

Hey, thanks for the feedback.

I haven't much experience with TSX myself, and we're missing a test for this extension, but my initial impression is that the opening { and closing } may be confusing things, as in syntax.json a comment is defined as \* ... *\ and it has to appear at the start of a line; at the moment that's not the case. Is that something you can test?

Superalexandre commented 9 months ago

Hey, I have some issue with TSX comment too,

A comment is { / ..... / } i can provide some test if needed

alstr commented 9 months ago

Looks like we need to update syntax.json as at the moment I don't think it's looking for that. I'll try and look next time I get chance.

Superalexandre commented 9 months ago

To be more specific a comment can be // /* */ {/* */} { /* */ }

Christoph-Koschel commented 8 months ago

This could be a hard issue, though, because we cannot just say that we allow any character before a TODO comment since when the programmer writes "//TODO" into a string, then the string would also match in an unexpected behavior. I also thought about a better solution because sometimes you write a comment behind code what is also currently not matched:

// TODO This is being matched
function foo(): string {
    let bar: string = "// TODO A TODO in a string";
    return bar; // TODO This don't match but should match
}

I try to make something up, but I'm open to ideas.

alstr commented 2 months ago

Hopefully will add support for end of line comments soon, if possible (#190).

If someone wants to submit a PR to include the other TSX comment patterns I'll be happy to merge it.