Re: Copypasta in the PostgreSQL source

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Copypasta in the PostgreSQL source
Дата
Msg-id 24806.1545085882@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Copypasta in the PostgreSQL source  (David Fetter <david@fetter.org>)
Ответы Re: Copypasta in the PostgreSQL source  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Copypasta in the PostgreSQL source  (David Fetter <david@fetter.org>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> Please find attached a run of a tool that looks for duplicated tokens.
> I've removed some things that seem like false positives, basically all
> from the stemmer part of the source, but there's still a lot.

I thought you were talking about problems like "that that" typos,
but on looking at the file, what this is actually complaining
about is any duplicated code segments anywhere.  I do not find
this helpful.  Refactoring to the point that dozen-line code
stanzas never appear more than once would be incredibly invasive,
likely very bad for performance, and I don't think it'd improve
readability either.

> - Would it make sense to make some kind of git commit trigger that at
>   least warns when a new one has been introduced?

Commit triggers are NOT the place for heuristics about code quality,
even if they're well-considered heuristics.

            regards, tom lane


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Copypasta in the PostgreSQL source