octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave coding style questions


From: Kai Torben Ohlhus
Subject: Re: Octave coding style questions
Date: Mon, 13 Jan 2020 18:48:22 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0

On 1/13/20 3:38 AM, Rik wrote:
> 
> I recently style-checked the Octave code base using a combination of astyle
> set for GNU coding standards and some Perl post-processing.  It still
> requires too much human inspection to review what the scripts find.

Rik, thanks for doing all this work.  I think ideally, there should be
no/not much human interaction at all.

Was it possible to document your exact Astyle command in the wiki [1]
and maybe upload your Perl scripts to "build-aux"?  Even better a short
script like "build-aux/enforce_Octave_cpp_style.sh" calling astyle and
your perl scripts correctly?

This might save many whitespace change "ping-pongs" before releases, if
all maintainers can enforce the same style guide "mechanically" and not
by interpreting [1] subjectively.  Especially, some patches became
inapplicable after some time this way.

> I don't think it particularly matters, and would prefer to let astyle
> correct this and then stop harassing me.  Are there any useful arguments
> agains this change?

I think astyle is a solid tool for this work and I have no objections to
make maintenance easier.


Just tried to let astyle help me using the `--style=gnu
--indent=spaces=2` options [2]:

```sh
cp -R default default2 && cd default2 && rm -Rf .hg gnulib libgnu
find . -name "*.h" -or -name "*.c" -or -name "*.cc" | xargs astyle
--style=gnu --indent=spaces=2 > astyle.txt
cat astyle.txt                    | wc -l  #1253
cat astyle.txt | grep "Formatted" | wc -l  #881
```

In 881 from 1253 files there was formatting necessary.  Thus I cannot
reproduce your style automatically.

Kai


[1] https://wiki.octave.org/C%2B%2B_style_guide
[2] http://astyle.sourceforge.net/astyle.html#_style=gnu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]