Project

General

Profile

Bug #6459

cstyle doesn't detect opening braces on the same line as function header

Added by Matthew Ahrens almost 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
tools - gate/build tools
Start date:
2015-11-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Our style guidelines require that the opening brace of a function
definition be on the line after the header, but the cstyle script
doesn't check it.

Additionally, if a function has a very long header, it is split onto to
two lines. These continuation lines are supposed to be indented by four
spaces, not a tab. However, cstyle does not verify that this is the
case.

This change updates the regular expressions to correctly detect these
cases.


Related issues

Related to illumos gate - Bug #8419: Should not require four-space indents on function arg continuation linesRejected2017-06-22

Actions

History

#1

Updated by Electric Monk almost 4 years ago

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

git commit c4567a616165806d1420a481659f5e10a97a1395

commit  c4567a616165806d1420a481659f5e10a97a1395
Author: Paul Dagnelie <pcd@delphix.com>
Date:   2015-11-24T04:18:51.000Z

    6459 cstyle doesn't detect opening braces on the same line as function header
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Alex Reece <alex@delphix.com>
    Reviewed by: Albert Lee <trisk@omniti.com>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

#2

Updated by Gordon Ross about 2 years ago

Unfortunately, the 2nd part of this bug description:

Additionally, if a function has a very long header, it is split onto
two lines. These continuation lines are supposed to be indented by
four spaces, not a tab. However, cstyle does not verify [ that ].

Causes a lot of cstyle noise that's really not desirable. See:
#8419 (Should not require four-space indents on function arg continuation lines)

#3

Updated by Marcel Telka about 2 years ago

  • Related to Bug #8419: Should not require four-space indents on function arg continuation lines added

Also available in: Atom PDF