-
Notifications
You must be signed in to change notification settings - Fork 112
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
PMD exception in Java source with variables or methods named with unicode characters for Windows workflow #1267
Comments
@c71n93 thanks for the report, here is a feedback: Problems
I would recommend including clear, step-by-step instructions to reproduce the error in the bug report. Please fix the bug report in order it to get resolved faster. |
@yegor256 As expected this problem occured in this project too: in this PR (#1268), in windows workflow (https://github.com/yegor256/qulice/actions/runs/9003058334/job/24732811660?pr=1268). |
@pnatashap may you can take a look? |
What is strange, the error is the same "Lexical error at line 61, column 22. Encountered: "\u2020" (8224), after : "" (in lexical state 0) |
@c71n93 the reason is in PMD, they use system property file.encoding to get default encoding, on Windows env it have Cp1251 (Check https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java#L38 it is still the same in current version). So you need to set it up at least for now. Example - pnatashap#9 @yegor256 There two variants to fix: 1. Keep code as is, because it can be fixed using system variables 2. add a parameter to set up encoding explicitly (also MVN parameter project.build.sourceEncoding can be used) |
@pnatashap I believe, |
@c71n93 eo project uses jcabi-parent (as a parent POM), where this is set: https://github.com/jcabi/jcabi-parent/blob/master/pom.xml#L96-L97 |
@yegor256 @c71n93 sourceEncoding doesn't help for now, only env variables will help. For now workaround is to set up
|
PMD fails to analyze Java source with variables or methods named with unicode characters. The exception only appears in windows workflow. PMD failed in this (objectionary/eo#3171) PR, for this (https://github.com/objectionary/eo/actions/runs/8973844023/job/24644892711?pr=3171) workflow.
Example of error message:
Part of the Java source file (
eo\eo-runtime\src\main\java\org\eolang\AtComposite.java
) related to this particular error:There was similar issues in PMD (pmd/pmd#3423) but as I understand, they were resolved in the PMD version that qulice currently uses.
@yegor256 I was hoping to see why windows CI doesn't crash with the same error in this project, but I found that there is no tests in
qulice-pmd
that contains unicode characters. I think it's worth adding these tests to understand the cause of the error that I described above.The text was updated successfully, but these errors were encountered: