Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-6206

More indentation issues...

    XMLWordPrintable

Details

    • MOODLE_27_STABLE
    • MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE

    Description

      It seems that the recent move to upstream indentation checker is causing a number of new reports when nested structures are used and closed (parenthesis) all together, instead of step by step.

      Example:

      $somevariable = some_function(another_function($param1, $param2),
              more_function($param3, array(
                      $key1 => $value1,
                      $key2 => $value2)));
      $continue = this_line_is_correct_but_codechecher_reports_eight_spaces_needed();
      

      The question is...

      A) should we ask for closing parenthesis to be un-indented step by step, exactly the same than closing curly brackets.

      $somevariable = some_function(another_function($param1, $param2),
              more_function($param3, array(
                      $key1 => $value1,
                      $key2 => $value2)
              )
      );
      $continue = this_line_is_correct_and_works_ok();
      

      B) Or, at very least, ask for the final parenthesis to close the whole sentence with correct indent in separate line.

      $somevariable = some_function(another_function($param1, $param2),
              more_function($param3, array(
                      $key1 => $value1,
                      $key2 => $value2))
      );
      $continue = this_line_is_correct_and_works_ok();
      

      C) Or closing the parenthesis at the 1st indentation level also works:

      $somevariable = some_function(another_function($param1, $param2),
              more_function($param3, array(
                      $key1 => $value1,
                      $key2 => $value2))
              );
      $continue = this_line_is_correct_and_works_ok();
      

      D) Or do we really want to allow the example above to be valid?

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              moodle.com, Eloy Lafuente (stronk7)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Jul/16