Bug #6459

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

Added by Matthew Ahrens almost 2 years ago. Updated 3 months ago.

Status:ClosedStart date:2015-11-18
Priority:NormalDue date:
Assignee:Matthew Ahrens% Done:

100%

Category:tools - gate/build tools
Target version:-
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 lines Rejected 2017-06-22

History

#1 Updated by Electric Monk almost 2 years ago

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

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 3 months 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 3 months ago

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

Also available in: Atom