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

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

Open
php-coder opened this issue Jun 9, 2023 · 2 comments
Open

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

php-coder opened this issue Jun 9, 2023 · 2 comments

Comments

@php-coder
Copy link
Contributor

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
Copy link
Contributor Author

php-coder commented Jun 29, 2023

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants