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/04/11 06:01:05 UTC

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

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


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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: brackets.patch

In the previously uploaded patch file, whitespace.patch, only whitespace was
changed.  In this file, brackets.patch, the only change is that brackets are
added to our C code and some whitepace gets modified.  

While AStyle has a setting which will insert brackets, it is not a full-on C
parser and will accept plenty of invalid constructs.  I don't trust AStyle to
always do the right thing, and thus I believe it's best to limit AStyle's
sphere of influence to whitespace alone by leaving the "--add-brackets"
directive out of our astylerc file.

However, using it to perform a one-time insertion of brackets, followed up by
careful manual QC, seems acceptable.

> 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, brackets.patch, lucytidy.pl, run_astyle.pl, whitespace.patch, whitespace_stages.tgz
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marvin Humphrey resolved LUCY-141.
----------------------------------

    Resolution: Fixed

Committed as r1098445, r1098447, r1098448 and r1098451.

As of r1098451, it is possible to run lucytidy.pl on the Lucy source tree -- with
perltidy disabled so that only C code is affected -- and no files will be
changed.

Our Perl code will be tidied using ordinary commits outside of this issue.

> 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, brackets.patch, compromises.diff, lucytidy.pl, run_astyle.pl, whitespace.patch, whitespace_stages.tgz
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: compromises.diff

The attached file, compromises.diff, adapts our C code in 4 places by adding
useless parentheses, in order to thwart AStyle from padding inappropriately
when presented with a cast where the '*' character is involved.  It's
unfortunate that we need this patch, but I think it's pretty harmless.

> 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, brackets.patch, compromises.diff, lucytidy.pl, run_astyle.pl, whitespace.patch, whitespace_stages.tgz
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: astylerc

> 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
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018191#comment-13018191 ] 

Marvin Humphrey commented on LUCY-141:
--------------------------------------

Known issues:

  * The QUOTE macro in Charmonizer baffles astyle.
  * 'extern "C" {' header guards cause an extra level of indenting. (See <http://sourceforge.net/tracker/index.php?func=detail&aid=1514844&group_id=2319&atid=102319>).
  * Since astyle isn't capable of enforcing line lengths, some lines are too long.

I think I'll try to work up a "run_astyle.pl" script that hacks around the
first two problems using placeholders.

It may also be possible to run .cfh Clownfish header files through astyle with
the following command:

{noformat}
astyle --options=devel/conf/astylerc --suffix=none --mode=c --recursive "*.cfh"
{noformat}

The results aren't perfect yet, though.

> 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
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018190#comment-13018190 ] 

Marvin Humphrey commented on LUCY-141:
--------------------------------------

Here's a recipe for applying the series of patches locally using git-svn.  I'm
a git n00b; I'm sure there's a better way to do this, but it'll work.

{noformat}
git svn clone -s -r 1090693 https://svn.apache.org/repos/asf/incubator/lucy/trunk lucystyle
cd lucystyle
cp /path/to/patches/*.patch .
cp /path/to/astylerc devel/conf/
patch -p1 < 0003-Remove-trailing-whitespace-from-C-code.patch
git commit -a
patch -p1 < 0004-Adapt-preprocessor-macros-for-pre-ANSI-style.patch
git commit -a
patch -p1 < 0005-Attach-opening-brackets-for-functions-to-end-of-the-.patch
git commit -a
patch -p1 < 0006-Break-function-body-opening-lines-when-they-exceed-7.patch
git commit -a
patch -p1 < 0007-Break-after-operator-because-astyle-does-not-indent-.patch
git commit -a
astyle --options=devel/conf/astylerc --suffix=none --recursive "core/*.c"
astyle --options=devel/conf/astylerc --suffix=none --recursive "perl/*.c"
astyle --options=devel/conf/astylerc --suffix=none --recursive "clownfish/*.c"
export GIT_PAGER="cat"
git diff
{noformat}

To zap changes since the last local commit, use "git reset --hard".  Try
alternating that with making changes to the astylerc.

> 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
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018189#comment-13018189 ] 

Marvin Humphrey commented on LUCY-141:
--------------------------------------

Here are several patches which manually apply the style changes which will be
enforced by astyle.  It is clearer to proceed in stages than to just run
everything through astyle and commit as one massive blob.

Really these style changes begin with 4 commits which have already made it
into the repository:

{noformat}
------------------------------------------------------------------------
r1090693 | marvin | 2011-04-09 14:44:48 -0700 (Sat, 09 Apr 2011) | 1 line

Remove trailing whitespace from C89-style comments.
------------------------------------------------------------------------
r1090692 | marvin | 2011-04-09 14:44:20 -0700 (Sat, 09 Apr 2011) | 1 line

Remove trailing whitespace from double-slash comments.
------------------------------------------------------------------------
r1090680 | marvin | 2011-04-09 13:36:57 -0700 (Sat, 09 Apr 2011) | 1 line

Remove trailing whitespace within ALv2 header comments.
------------------------------------------------------------------------
r1090538 | marvin | 2011-04-09 00:36:35 -0700 (Sat, 09 Apr 2011) | 2 lines

Add brackets to all multi-line single-statement conditionals.
------------------------------------------------------------------------
{noformat}

Here is my local git log, including some changes pushed to our svn 
repository.

{noformat}
commit 1c8d55fdff30530dd61e8a1ae50b97b7b3803f57
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   Sun Apr 10 12:26:20 2011 -0700

    Break after '=' operator, because astyle does not indent lines that start
    with '=' properly.

commit 38d5f0abb8e2fd1973cb2856d8e37eb9c05fc838
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   Sun Apr 10 11:57:19 2011 -0700

    Break function body opening lines when they exceed 78 characters.

commit 4c83ce9003600cd7654aee2fd6ea788d21d4e518
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   Sun Apr 10 11:21:46 2011 -0700

    Attach opening brackets for functions to end of the declaration line, rather
    than dedicate a full line to each opening bracket.

commit 5414b6f2c529ba588d49a6a96c90a0544213f42b
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   Sat Apr 9 15:56:56 2011 -0700

    Adapt preprocessor macros for pre-ANSI style.

commit 44751cbe3942d520dd3c90f7f3a016ade45045a7
Author: Marvin Humphrey <ma...@rectangular.com>
Date:   Sat Apr 9 15:47:22 2011 -0700

    Remove trailing whitespace from C code.

commit 41355683ea0225092397468e1f51ee1f9465fb6e
Author: marvin <ma...@13f79535-47bb-0310-9956-ffa450edef68>
Date:   Sat Apr 9 21:44:48 2011 +0000

    Remove trailing whitespace from C89-style comments.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/lucy/trunk@1090693 13f79535-47bb-0310-9956-ffa450edef68

commit 891aebcf02e3f0302e88ed56fd366e7dcec79a18
Author: marvin <ma...@13f79535-47bb-0310-9956-ffa450edef68>
Date:   Sat Apr 9 21:44:20 2011 +0000

    Remove trailing whitespace from double-slash comments.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/lucy/trunk@1090692 13f79535-47bb-0310-9956-ffa450edef68

commit f57125f86fd88baf8d52cc4c45ea2a2c9cb6be59
Author: marvin <ma...@13f79535-47bb-0310-9956-ffa450edef68>
Date:   Sat Apr 9 20:36:57 2011 +0000

    Remove trailing whitespace within ALv2 header comments.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/lucy/trunk@1090680 13f79535-47bb-0310-9956-ffa450edef68

{noformat}


(In retrospect, I regret having begun these commits before the final style
questions were completely worked out.  Using git-svn as a Subversion client is
great for building multi-stage commits.)

The patch removing trailing whitespace from C code just does what astyle
was going to do.  The change is invisible unless you're viewing a diff.

The preprocessor change is necessary because astyle forces all preprocessor
macros into the first column.  This is old-fashioned and not necessary for any
modern compiler, but an alternative indentation style which accomodates 
astyle's quirk seems to suffice.

The two commits relating to brackets implement the astyle preference
--brackets=attach.

The commit changing where we break around the '=' operator is necessary
because astyle can't figure out that it needs to indent lines that begin with
'='.  As a former graphic designer I believe breaking before '=' is superior,
but oh well.


> 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
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: astylerc

Here is a new version of the astylerc file which adds the directive
"--max-instatement-indent=79".  Without this setting, continuation lines for
deeply indented statements become impossible to line up manually.


> 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, 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: 0007-Break-after-operator-because-astyle-does-not-indent-.patch
                0006-Break-function-body-opening-lines-when-they-exceed-7.patch
                0005-Attach-opening-brackets-for-functions-to-end-of-the-.patch
                0004-Adapt-preprocessor-macros-for-pre-ANSI-style.patch
                0003-Remove-trailing-whitespace-from-C-code.patch

> 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
>
>
> 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: run_astyle.pl

This run_astyle.pl script works around a couple bugs and quirks in astyle: it handles the Charmonizer QUOTE macro correctly, and it avoids spurious indentation due to 'extern "C" {' C++ guards in header files.

> 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, 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

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

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: whitespace_stages.tgz
                whitespace.patch

Here is a patch which applies all the changes which AStyle (under lucytidy.pl)
will impose on our C code and also performs some manual cleanups.  I'm
supplying it in two forms.

  * A single ominbus "whitespace.patch".
  * A series of patches, prepared under git, "whitespace_stages.tgz".

I intend to apply these changes as a single commit so that we don't clutter
our version control history with whitespace entries.  For a more coherent
perspective on what was changed than you get from the squashed patch, people
can consult the staged version here.

> 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, whitespace.patch, whitespace_stages.tgz
>
>
> 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