From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: How to check code indentation? Date: Tue, 26 Sep 2017 02:59:43 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: 9OC/PY8QRnnqnNGuo4rrrw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.14.10 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:48227 Date: 2017-09-26T02:59:43+03:00 List-Id: Anh Vo wrote: > On Monday, September 25, 2017 at 4:10:33 PM UTC-7, Victor Porton wrote: >> Victor Porton wrote: >> >> > I have a source code where some declarations or statements are indented >> > wrongly. An example: >> > >> > function raptor_namespaces_find_namespace (Stack: >> > Namespace_Stack_Handle; >> > Prefix: chars_ptr; >> > Len: int) >> > return Namespace_Handle >> > with Import, Convention=>C; >> > >> > ("Prefix" is not below "Stack" but two spaces are extraneous.) >> > >> > I use -gnaty3 but weirdly GNAT 7.2.0 does not detect this error. >> > >> > Is there any free tool to check (or even better automatically correct) >> > Ada (preferably Ada2012) indentation? >> >> Hm, GNAT GPS does (however sometimes wrong) Ada code reformatting when >> pressing Tab key. >> >> Can it be scripted in some way to do Ada reformatting automatically for a >> set of source files? > > Have you looked at gnatpp command? Thanks, I am now checking it. But it seems not to work :-( Consider this short file test.ads: package test is end test; I run /usr/local/stow/gnat-gpl-2017-x86_64-linux-bin/bin/gnatpp -i3 test.ads There is no output and the file is not changed, it's wrong alignment remains. What is wrong? -- Victor Porton - http://portonvictor.org