You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/09/14 20:17:19 UTC

[GitHub] [incubator-daffodil] tuxji commented on a change in pull request #418: Add warnings for properties which look like expressions

tuxji commented on a change in pull request #418:
URL: https://github.com/apache/incubator-daffodil/pull/418#discussion_r488177066



##########
File path: daffodil-lib/src/main/scala/org/apache/daffodil/schema/annotation/props/PropertyScoping.scala
##########
@@ -131,6 +138,22 @@ trait FindPropertyMixin extends PropTypes {
           lr
         }
       }
+    /* if this looks like it could be an epression, issue a warning */

Review comment:
       Agree comment should use //, also note comment misspells expression

##########
File path: daffodil-lib/src/main/scala/org/apache/daffodil/schema/annotation/props/PropertyScoping.scala
##########
@@ -131,6 +138,22 @@ trait FindPropertyMixin extends PropTypes {
           lr
         }
       }
+    /* if this looks like it could be an epression, issue a warning */
+    /* only if isForExpression is false*/
+    /* for runtime mixins, need to supply true, other places, no change*/
+    if( ! isForExpression ) {
+      propRes match{ 
+        case Found( v, _, _, _ ) => {
+
+          if( v.startsWith( "{")) {
+            SDW( WarnID.NonExpressionPropertyValueLooksLikeExpression, "Property %s that looks like an expression cannot be an expression: %s", pname, v )

Review comment:
       That line (as well as a couple other lines) also has spaces between the parentheses which should be removed to fit Daffodil's style guide.  Just for curiosity I googled scalariform (a formatter I remember hearing about) and I found this page which shows how to set up sbt to format the code while building it or use a pre-commit hook to ensure the code remains formatted consistently.  Should we (the Daffodil committers) consider doing that for Daffodil?
   
   <https://leaks.wanari.com/2017/05/04/scala-code-formatters>




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org