Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1651)

Issue 4662074: Adapt fixcc.py to use Astyle and/or emacs (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 10 months ago by Keith
Modified:
12 years, 9 months ago
Reviewers:
carl.d.sorensen, c_sorensen, Graham Percival (old account), Graham Percival, janneke, t.daniels, janneke
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Adapt fixcc.py to use Astyle instead of emacs, results in patch set 3 and then try the resulting cleaned-up fixcc.py, with emacs, results in patch set 4 Finally, we seem happiest with fixcc.py using Astyle, results in patch set 5

Patch Set 1 : tidy #

Total comments: 1

Patch Set 2 : Patch Set 2 : Restrict fixcc.py, add sample files #

Patch Set 3 : run fixcc.py on a several files #

Total comments: 15

Patch Set 4 : Restricted fixcc prefilter + emacs #

Patch Set 5 : Back to fixcc(astyle) #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1061 lines, -1037 lines) Patch
M Documentation/contributor/programming-work.itexi View 1 2 3 4 2 chunks +3 lines, -33 lines 1 comment Download
M flower/include/direction.hh View 1 2 4 1 chunk +24 lines, -24 lines 0 comments Download
M flower/include/matrix.hh View 1 2 4 3 chunks +5 lines, -5 lines 0 comments Download
M flower/polynomial.cc View 1 2 4 5 chunks +18 lines, -17 lines 0 comments Download
M lily/align-interface.cc View 1 2 3 4 10 chunks +14 lines, -15 lines 0 comments Download
M lily/audio-item.cc View 1 2 3 4 6 chunks +20 lines, -22 lines 0 comments Download
M lily/beam.cc View 1 2 3 4 54 chunks +92 lines, -105 lines 0 comments Download
M lily/beam-quanting.cc View 1 2 3 4 26 chunks +127 lines, -121 lines 0 comments Download
M lily/chord-name-engraver.cc View 1 2 3 4 5 chunks +31 lines, -31 lines 0 comments Download
M lily/constrained-breaking.cc View 1 2 4 13 chunks +18 lines, -19 lines 0 comments Download
M lily/context.cc View 1 2 3 4 15 chunks +29 lines, -31 lines 0 comments Download
M lily/function-documentation.cc View 1 2 3 4 5 chunks +31 lines, -34 lines 0 comments Download
M lily/general-scheme.cc View 1 2 3 4 12 chunks +32 lines, -36 lines 0 comments Download
M lily/grob.cc View 1 2 3 4 15 chunks +15 lines, -23 lines 0 comments Download
M lily/grob-scheme.cc View 1 2 4 10 chunks +3 lines, -14 lines 0 comments Download
M lily/include/page-layout-problem.hh View 1 2 4 2 chunks +19 lines, -18 lines 0 comments Download
M lily/include/translator.hh View 1 2 3 4 4 chunks +13 lines, -15 lines 0 comments Download
M lily/lily-guile.cc View 1 2 3 4 15 chunks +17 lines, -31 lines 0 comments Download
M lily/lily-lexer-scheme.cc View 1 2 4 1 chunk +4 lines, -4 lines 0 comments Download
M lily/main.cc View 1 2 3 4 15 chunks +54 lines, -52 lines 0 comments Download
M lily/page-breaking.cc View 1 2 3 4 25 chunks +61 lines, -61 lines 0 comments Download
M lily/slur.cc View 1 2 3 4 11 chunks +16 lines, -19 lines 0 comments Download
M lily/slur-scoring.cc View 1 2 3 4 18 chunks +38 lines, -40 lines 0 comments Download
M lily/stem.cc View 1 2 3 4 23 chunks +43 lines, -49 lines 0 comments Download
M scripts/auxiliar/fixcc.py View 1 2 3 4 10 chunks +69 lines, -181 lines 3 comments Download
M test.c View 1 2 3 4 1 chunk +36 lines, -37 lines 0 comments Download
A testfile_fixcc_emacs.c View 1 2 3 4 1 chunk +115 lines, -0 lines 0 comments Download
A testfile_in.c View 1 2 3 4 1 chunk +114 lines, -0 lines 0 comments Download

Messages

Total messages: 28
Keith
This script, applied to the .cc .icc and .hh files in flower/ and lily/, gives ...
12 years, 10 months ago (2011-07-03 02:36:32 UTC) #1
Carl
Can you make it possible for us to see the diff caused by applying this ...
12 years, 10 months ago (2011-07-03 02:41:15 UTC) #2
Graham Percival (old account)
On 2011/07/03 02:41:15, Carl wrote: > Can you make it possible for us to see ...
12 years, 10 months ago (2011-07-03 07:22:07 UTC) #3
Keith
On 2011/07/03 07:22:07, Graham Percival wrote: > 1. all // comments are now hard-left (i.e. ...
12 years, 10 months ago (2011-07-03 08:15:04 UTC) #4
Keith
I really, really, wish Astyle had a fully gnu-compliant mode out of the box. I ...
12 years, 9 months ago (2011-07-04 03:33:19 UTC) #5
t.daniels_treda.co.uk
<k-ohara5a5a@oco.net> wrote Monday, July 04, 2011 4:33 AM >I really, really, wish Astyle had a ...
12 years, 9 months ago (2011-07-04 07:43:05 UTC) #6
t.daniels_treda.co.uk
<k-ohara5a5a@oco.net> wrote Monday, July 04, 2011 4:33 AM >I really, really, wish Astyle had a ...
12 years, 9 months ago (2011-07-04 07:43:05 UTC) #7
janneke_gnu.org
Trevor Daniels writes: > I agree. This is a big improvement, and would > give ...
12 years, 9 months ago (2011-07-04 09:28:26 UTC) #8
Graham Percival
On Mon, Jul 04, 2011 at 11:28:19AM +0200, Jan Nieuwenhuizen wrote: > While the work ...
12 years, 9 months ago (2011-07-04 09:41:56 UTC) #9
c_sorensen
On 7/4/11 3:28 AM, "Jan Nieuwenhuizen" <janneke@gnu.org> wrote: > Trevor Daniels writes: > >> I ...
12 years, 9 months ago (2011-07-04 16:26:15 UTC) #10
t.daniels_treda.co.uk
Jan Nieuwenhuizen wrote Monday, July 04, 2011 10:28 AM > Trevor Daniels writes: > >> ...
12 years, 9 months ago (2011-07-04 16:32:32 UTC) #11
Keith
On 2011/07/04 09:28:26, janneke_gnu.org wrote: > > The GNU standards are implemented by Emacs, Well, ...
12 years, 9 months ago (2011-07-04 20:45:23 UTC) #12
Keith
On 7/4/11 11:32 PM, "Jan Nieuwenhuizen" <janneke <at> gnu.org> wrote: >> Also, I tried to ...
12 years, 9 months ago (2011-07-05 08:00:59 UTC) #13
Graham Percival (old account)
wait, WTF just happened? We're no longer using astyle, and instead we'll be requiring everybody ...
12 years, 9 months ago (2011-07-06 14:40:56 UTC) #14
janneke
On 2011/07/06 14:40:56, Graham Percival wrote: > wait, WTF just happened? We're no longer using ...
12 years, 9 months ago (2011-07-06 16:33:12 UTC) #15
Graham Percival (old account)
On 2011/07/06 16:33:12, jan.nieuwenhuizen wrote: > On 2011/07/06 14:40:56, Graham Percival wrote: > > wait, ...
12 years, 9 months ago (2011-07-06 17:26:02 UTC) #16
janneke
On 2011/07/06 17:26:02, Graham Percival wrote: > Please tell me that you are not seriously ...
12 years, 9 months ago (2011-07-06 19:04:11 UTC) #17
Keith
On 2011/07/06 19:04:11, jan.nieuwenhuizen wrote: > On 2011/07/06 17:26:02, Graham Percival wrote: > > Please ...
12 years, 9 months ago (2011-07-06 19:30:52 UTC) #18
janneke
On 2011/07/06 19:30:52, Keith wrote: > So we can > 1) trust emacs users to ...
12 years, 9 months ago (2011-07-06 19:42:47 UTC) #19
Graham Percival
On Wed, Jul 06, 2011 at 07:04:11PM +0000, jan.nieuwenhuizen@gmail.com wrote: > I do think that ...
12 years, 9 months ago (2011-07-06 19:55:46 UTC) #20
Graham Percival
On Wed, Jul 06, 2011 at 07:30:52PM +0000, k-ohara5a5a@oco.net wrote: > However, I can't seem ...
12 years, 9 months ago (2011-07-06 20:03:22 UTC) #21
k-ohara5A5A_oco.net
-------- Original Message -------- > From: "Graham Percival" <graham@percival-music.ca> > Sent: Wednesday, July 06, 2011 ...
12 years, 9 months ago (2011-07-07 05:06:35 UTC) #22
Keith
I will be away for a long weekend, back Monday, late late Monday, UTC.
12 years, 9 months ago (2011-07-08 05:45:27 UTC) #23
Keith
It seems everyone is happy to use astyle as the indenter (it sure is faster) ...
12 years, 9 months ago (2011-07-14 04:33:57 UTC) #24
t.daniels_treda.co.uk
k-ohara5a5a@oco.net wrote Thursday, July 14, 2011 5:33 AM > It seems everyone is happy to ...
12 years, 9 months ago (2011-07-14 07:48:24 UTC) #25
Keith
On Thu, 14 Jul 2011 00:47:58 -0700, Trevor Daniels <t.daniels@treda.co.uk> wrote: > > I was ...
12 years, 9 months ago (2011-07-15 03:51:08 UTC) #26
t.daniels_treda.co.uk
Keith OHara wrote Friday, July 15, 2011 4:50 AM > On Thu, 14 Jul 2011 ...
12 years, 9 months ago (2011-07-15 07:47:18 UTC) #27
Keith
12 years, 9 months ago (2011-07-30 03:16:07 UTC) #28
http://codereview.appspot.com/4662074/diff/26001/scripts/auxiliar/fixcc.py
File scripts/auxiliar/fixcc.py (right):

http://codereview.appspot.com/4662074/diff/26001/scripts/auxiliar/fixcc.py#ne...
scripts/auxiliar/fixcc.py:70: ('
(::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|\+|-|=|/|:|&XXX|\||\*XXX) *\n(
*)([^\s#])', '\n\\2\\1 \\3'),
The snippet match for #include cuts the string before the #, hiding it from the
regex engine. If we change this to leave the # for the C analysis, we can use a
negative lookahead.

http://codereview.appspot.com/4662074/diff/26001/scripts/auxiliar/fixcc.py#ne...
scripts/auxiliar/fixcc.py:119: \#[ \t]*define[ \t]+([^\n]*\\\n)*[^\n]*))''',
consider leaving the # outside the match, so the CXX regex can find it. This
makes it easier to avoid deleting the newline before a #pragma or #define

http://codereview.appspot.com/4662074/diff/26001/scripts/auxiliar/fixcc.py#ne...
scripts/auxiliar/fixcc.py:138: "([^"\n]|\\")*"))''',
consider leaving the "" outside the <match>, so the CXX regex can see it. 
Otherwise the CXX regex does not know if the pre-matched portion is a string or
a #define or a comment.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b