Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8491

@NamingConvention: Supply class/method/field/... name patterns to compiler

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Compiler
    • None

    Description

      • Introduce a @NamingConvention annotation, that supplies patterns for class/method/field/... names allowed/used in the project to the Groovy compiler
      • Example:
        @NamingConvention(
          classes=/[A-Z][A-Za-z0-9]{3,}/,
          methods=/[a-z][A-Za-z0-9]+/,
          fields=/[a-z][A-Za-z0-9_]*/
          variables=/[a-z0-9_]+/,
          parameters=/[a-z]+/,
        )
        class Foo {
          // Classes used inside of class start with an uppercase  
          // letter followed by 3 letter/digit combinations, etc
        } 
        
      • This would supply a speedup for e.g. class lookups, since any name that does not match the given class pattern can be dismissed immediately

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              emge mgroovy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: