You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore.
If any of the resulting package name components are keywords (§3.9), append an underscore to them.
If any of the resulting package name components start with a digit, or any other character that is not allowed as an initial character of an identifier, have an underscore prefixed to the component.
Use Case
Here is a snippet I used to correct the issue within Projen because hyphens, -, aren't legal characters for java packages:
Describe the feature
How might invalid java identifiers, https://docs.oracle.com/javase/specs/jls/se12/html/jls-3.html#jls-3.8, be handled?
Here is a reference for "Package Names and Module Names" https://docs.oracle.com/javase/specs/jls/se12/html/jls-6.html#jls-6.1
Use Case
Here is a snippet I used to correct the issue within Projen because hyphens,
-
, aren't legal characters for java packages:Proposed Solution
Two options:
ERROR
/FAIL
message stating invalid java identifiers detectedWARN
message stating invalid java identifiers convertedOther Information
When using hypens,
-
, for example, there are tons of compilation errors and somewhat difficult to trace:Acknowledgements
CDK version used
2.148.0
Environment details (OS name and version, etc.)
macOS Sonoma 14.5
The text was updated successfully, but these errors were encountered: