octave-maintainers
[Top][All Lists]
Advanced

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

Re: astyle configuration


From: Rik
Subject: Re: astyle configuration
Date: Mon, 13 Jan 2020 07:44:30 -0800

On 01/13/2020 01:48 AM, Kai Torben Ohlhus wrote:
> 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
>
I will work a bit more on this.  I use a separate file called astylerc
which throws many more configuration switches

--style=gnu
--indent=spaces=2
--max-code-length=80
--min-conditional-indent=0
--indent-namespaces
--indent-labels
--indent-cases
--pad-header
--keep-one-line-blocks
--keep-one-line-statements

--Rik




reply via email to

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