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

migrate IllegalToken to properties macros #13860

Closed
romani opened this issue Oct 9, 2023 · 6 comments · Fixed by #13883
Closed

migrate IllegalToken to properties macros #13860

romani opened this issue Oct 9, 2023 · 6 comments · Fixed by #13883

Comments

@romani
Copy link
Member

romani commented Oct 9, 2023

[INFO] Running com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest
[ERROR] Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 6.079 s <<< FAILURE! -- in com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest
[ERROR] com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.testAllCheckSections -- Time elapsed: 0.175 s <<< FAILURE!
illegaltoken.xml section 'IllegalToken' should have all the acceptable tokens
expected: set of any supported tokens
but was : TokenTypes
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.validatePropertySectionPropertyTokens(XdocsPagesTest.java:1069)
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.validatePropertySectionProperties(XdocsPagesTest.java:964)
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.validatePropertySection(XdocsPagesTest.java:805)
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.validateCheckSection(XdocsPagesTest.java:662)
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.testAllCheckSections(XdocsPagesTest.java:579)

@romani romani added the approved label Oct 9, 2023
@piyush-1234
Copy link
Contributor

hi romani, i want to pick this issue.

@romani
Copy link
Member Author

romani commented Oct 12, 2023

@piyush-1234 , I highly recommend to read https://github.com/checkstyle/checkstyle/wiki/To-GSoC-participant and start working from issues we suggest in this wiki page.

@piyush-1234
Copy link
Contributor

@piyush-1234 , I highly recommend to read https://github.com/checkstyle/checkstyle/wiki/To-GSoC-participant and start working from issues we suggest in this wiki page.

thanx for recommendation @romani, starting with the issues having tag gsoc first issue.

@relentless-pursuit
Copy link

I am on it

@relentless-pursuit
Copy link

relentless-pursuit commented Oct 13, 2023

@romani I am stuck on this error:

illegaltoken.xml section 'IllegalToken' should have all the acceptable tokens
expected: set of any supported tokens
but was : TokenTypes
Expected :set of any supported tokens
Actual   :TokenTypes

The only reference i found for set of any supported token is descendanttoken.xml.

            <tr>
              <td>tokens</td>
              <td>tokens to check</td>
              <td>set of any supported
                <a href="../../apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html">
                    tokens</a>
              </td>
              <td><code>empty</code></td>
              <td>3.2</td>
            </tr>

Any clue on how to progress? Should i alter the xml to make the test cases pass?

@relentless-pursuit
Copy link

Update:

<tr>
  <td>tokens</td>
  <td>tokens to check</td>
  <td>set of any supported
    <a href="../../apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html">
        tokens</a>
  </td>
  <td>
    <a href="../../apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LABELED_STAT">LABELED_STAT</a>
      .
  </td>
  <td>3.2</td>
</tr>

Logs:

Column 0: tokens
Column 1: tokens to check
Column 2: TokenTypes
Column 3: LABELED_STAT                 .
Column 4: 3.2

The text content of the third element in the XML is "set of any supported tokens", but the debug output for Column 2 is "TokenTypes", which is a mismatch. I am not sure why is it happening but still trying to look in PropertiesMacros. If any insights, please let me know.

relentless-pursuit pushed a commit to relentless-pursuit/checkstyle that referenced this issue Oct 14, 2023
relentless-pursuit pushed a commit to relentless-pursuit/checkstyle that referenced this issue Oct 14, 2023
relentless-pursuit pushed a commit to relentless-pursuit/checkstyle that referenced this issue Oct 18, 2023
relentless-pursuit pushed a commit to relentless-pursuit/checkstyle that referenced this issue Oct 18, 2023
relentless-pursuit pushed a commit to relentless-pursuit/checkstyle that referenced this issue Oct 19, 2023
relentless-pursuit pushed a commit to relentless-pursuit/checkstyle that referenced this issue Oct 19, 2023
@github-actions github-actions bot added this to the 10.12.5 milestone Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants