You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucy.apache.org by "Marvin Humphrey (JIRA)" <ji...@apache.org> on 2011/05/01 20:29:03 UTC

[lucy-issues] [jira] [Updated] (LUCY-141) Auto-format C code using astyle

     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marvin Humphrey updated LUCY-141:
---------------------------------

    Attachment: lucytidy.pl

Here is a new executable, lucytidy.pl, which expands on the previously
supplied run_astyle.pl.  It wraps not only AStyle, but also Perltidy and
potentially others, and is meant to be run on the entire Lucy source tree.

In addition to the run_astyle.pl hacks which prevent AStyle from destroying
the Charmonizer QUOTE macros and improperly indenting headers because of
__cplusplus guards, lucytidy.pl adds a few more hacks, addressing nearly all
of AStyle's quirks and bugs.

  * AStyle is no longer allowed to screw up the
    break-before-assignment-operator idiom.
  * Doesn't allow AStyle to force all preprocessor directives into column 1.
  * Prevents AStyle from detaching closing "while" from its bracket in a
    do-while loop, an undesirable side effect of the setting which uncuddles
    elses.
  * Prevents AStyle from confusing the dereference operator for the
    multiplication operator under certain circumstances and space-padding it
    -- at least some of the time.

lucytidy.pl also adds the following features and improvements over
run_astyle.pl:

  * Non-destructive by default, but allows destructive edit with --suffix=""
    option.
  * Skips certain directories we don't want to tidy, e.g. the bundled Snowball
    C source code.
  * Allows you to specify the locations of the formatter executables with the
    --astyle and --perltidy options.
  * Files are only updated when changed.

> Auto-format C code using astyle
> -------------------------------
>
>                 Key: LUCY-141
>                 URL: https://issues.apache.org/jira/browse/LUCY-141
>             Project: Lucy
>          Issue Type: Improvement
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>             Fix For: 0.1-incubating
>
>         Attachments: 0003-Remove-trailing-whitespace-from-C-code.patch, 0004-Adapt-preprocessor-macros-for-pre-ANSI-style.patch, 0005-Attach-opening-brackets-for-functions-to-end-of-the-.patch, 0006-Break-function-body-opening-lines-when-they-exceed-7.patch, 0007-Break-after-operator-because-astyle-does-not-indent-.patch, astylerc, astylerc, lucytidy.pl, run_astyle.pl
>
>
> We should consider using the automatic code formatter astyle for 
> our C code.
> Dev list thread: http://s.apache.org/INC

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira