Re: pgsql: Run the C portions of guc-file.l through pgindent.

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pgsql: Run the C portions of guc-file.l through pgindent.
Дата
Msg-id 55914FF8.80108@dunslane.net
обсуждение исходный текст
Ответ на Re: pgsql: Run the C portions of guc-file.l through pgindent.  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-committers
On 06/28/2015 09:24 PM, Michael Paquier wrote:
> On Mon, Jun 29, 2015 at 9:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Run the C portions of guc-file.l through pgindent.
>>
>> Yeah, I know, pretty anal-retentive of me.  But we oughta find some
>> way to automate this for the .y and .l files.
> .y files may be tricky and .l files less. Still one good way to test
> such things would be to use something like that and see at least what
> happens when doing a run (haven't tested, use at your own risk):
> diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent
> index 0d3859d..3995214 100755
> --- a/src/tools/pgindent/pgindent
> +++ b/src/tools/pgindent/pgindent
> @@ -519,6 +519,7 @@ File::Find::find(
>                          (($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_))
>                            && -f _
>                            && /^.*\.[ch]\z/s
> +                         && /^.*\.(h|c|y|l)\z/s
>                            && push(@files, $File::Find::name);
>                    }
>          },
>
> Regards,

Try it and see. I would expect it to blow up badly. It should be
possible to teach pgindent to extract the C portions of the files,
indent them and then replace them. Of course, especially in the case of
.y files, that would exclude almost all of the files in many cases.

cheers

andrew



В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Replace ia64 S_UNLOCK compiler barrier with a full memory barrie
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Code + docs review for escaping of option values (commit 11a020e