Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14540

Change the switch/case indentation sourcecheck policy

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.x
    • build system
    • None
    • Unknown

    Description

      Since recently I have been playing with our sourcheck to hook it in as a GitHub action at each PR, I have been fixing some sourcecheck findings leftover from previous unchecked commits.

      Most of the stuff makes sense but this one:

      // Some comments here
              <module name="Indentation">
                  <property name="lineWrappingIndentation" value="0"/>
                  <property name="caseIndent" value="0"/>
              </module>
      

      this impose that switch/case blocks should be in the form of:

      switch(...) {
      case:
          ...
      case:
          ...
      case:
          ...
      default:
      }
      

      i.e. switch and case keywords MUST have the same indentation. I have searched a little bit and it seems this is not widely used as a code style, the tendency is to have the case indented.

      Since there are 2053 occurrences of switch/case blocks, before attempting to fix this I would like a general agreement on this.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            valdar Andrea Tarocchi
            valdar Andrea Tarocchi
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment