Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4047

change wording of 'non productive expression' errors

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 3.7.5
    • Compiler
    • None
    • 1
    • Language 2015-03-04, Language 2015-03-18

    Description

      The new valiidator emits errors for non productive expressions. This because they are meaningless (produce values that are thrown away and does not cause side effects) and probably mask other problems.

      While this is good in general - there are cases when developing code that makes this annoying.

      Consider this:

      if true {
        # commented out
      }
      $a = 10
      

      Here, the entire if-expression is non productive (and it can be removed), It seems harsh to report this as an error (at all times).

      I am reluctant to always turning this into a warning, but can imagine a mode where non-productive expressions are either ignored, or that they produce a warning. We could add a setting for 'non_productive_expression' and accept the values: ignore, warning, error - where error is the default.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              henrik.lindberg Henrik Lindberg
              Kurt Wall Kurt Wall
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support