Project

General

Profile

Actions

Task #4383

closed

Fix GNU-style indentation of braces

Added by Junxiao Shi over 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

GNU-style indentation of braces is not longer permitted in code-style.
This issue is to fix existing code of such violations.

Actions #1

Updated by Junxiao Shi over 6 years ago

You may find violations in a repository with this script:

find -name '*.hpp' -or -name '*.cpp' -exec awk '
BEGIN {
  indent = "*"
}
indent != "*" {
  if (substr($0, 1, length(indent) + 3) == indent "  {") {
    print FILENAME " " (FNR - 1) " " lastline
    print FILENAME " " FNR " " $0
  }
  indent = "*"
}
$1 ~ /^(if|else|for|while|do|try)$/ {
  split($0, a, $1)
  indent = a[1]
  lastline = $0
}
' {} +
Actions #2

Updated by Davide Pesavento over 6 years ago

Junxiao Shi wrote:

GNU-style indentation of braces is not longer permitted in code-style.

That applies to new and updated code. It doesn't mean we need to actively "fix" all existing code.

Actions #3

Updated by Junxiao Shi over 6 years ago

Yes. #1403-2 mandates every touched file to conform to code style, but in the past the reviewer has asked to separate code style fixes into its own commit. This issue is created so that those commits have an issue to associate with.

Actions #4

Updated by Davide Pesavento over 5 years ago

  • Category deleted (Build)
  • Start date deleted (11/16/2017)
Actions #5

Updated by Davide Pesavento over 5 years ago

  • Tags changed from code-cleanup to CodeCleanup
Actions #6

Updated by Davide Pesavento over 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

I don't think we have any code that still uses GNU-style indentation. Let's close this.

Actions #7

Updated by Davide Pesavento almost 4 years ago

  • Tags changed from CodeCleanup to code-cleanup
Actions

Also available in: Atom PDF