cqfn / pdd

Command line toolkit for collecting TODO markers from your code, known as Puzzle Driven Development (PDD)
https://www.0pdd.com
MIT License
76 stars 25 forks source link

Trailing */ is included in <body> while it shouldn't #225

Open php-coder opened 1 year ago

php-coder commented 1 year ago

One of the examples from https://github.com/cqfn/pdd#how-to-format doesn't work as expected.

$ cat Test.java
/* @todo #TEST-13 */
/* @todo #TEST-14 Make it work */
void main() {}

$ pdd -v -f pdd-bug.xml
My version is 0.23.1
Ruby version is 2.7.8 at x86_64-linux
Reading from root dir /data/mystamps
/data/mystamps/pdd-bug.xml is a binary file (0 bytes)
Reading Test.java ...
Puzzle TEST-13-c4c9bdd4 0/DEV at Test.java
Puzzle TEST-14-95e7863d 0/DEV at Test.java

$ cat pdd-bug.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='http://pdd-xsl.teamed.io/0.23.1.xsl'?>
<puzzles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://pdd-xsd.teamed.io/0.23.1.xsd" version="0.23.1" date="2023-06-09T04:58:16Z">
  <puzzle>
    <ticket>TEST-13</ticket>
    <estimate>0</estimate>
    <role>DEV</role>
    <id>TEST-13-c4c9bdd4</id>
    <lines>1-1</lines>
    <body>*/</body>
    <file>Test.java</file>
  </puzzle>
  <puzzle>
    <ticket>TEST-14</ticket>
    <estimate>0</estimate>
    <role>DEV</role>
    <id>TEST-14-95e7863d</id>
    <lines>2-2</lines>
    <body>Make it work */</body>
    <file>Test.java</file>
  </puzzle>
</puzzles>

Expected behavior: The comment /* @todo #TEST-14 Make it work */ should produce <body>Make it work</body>

Observed behavior: The comment /* @todo #TEST-14 Make it work */ produces <body>Make it work */</body>

php-coder commented 1 year ago

BTW fix of this issue will break existing puzzles as it changes puzzle id of the existing comments and 0pdd will create new issues for the existing puzzles.

pnatashap commented 6 months ago

For now it is better to remove this time of the comments from supported, as it is not supported at all: there is only a logic to delete code from the beginning of the line. I think that this format is not very popular, I do not use it, for example