Summary:
Add new arc lint rules for postgres files:
- likely_bad_closing_brace: in case of a pattern such as
if (...)
{
...
} else
...
throw a lint error. This is not covered by the existing
likely_bad_brace (now renamed to likely_bad_opening_brace). This is a
warning, not error, because upstream PG code sometimes fails to comply
with this.
- likely_bad_pointer: the asterisk of pointers should be in order
space-asterisk, not asterisk-space. This is a warning, not error,
because upstream PG code sometimes fails to comply with this and it
sometimes throws false positives for text in comments.
- bad_parameter_comment_spacing: sometimes, for function calls, when
passing arguments, a small inline code comment follows an argument
specifying what the parameter name is. Such comments should ideally
be of the form /* param_name */, but sometimes, people mess up the
spacing around it. Make this specific rule only catch issues such as
/*param_name */, /* param_name*/, /*param_name*/, but not issues where
there are multiple spaces added because upstream PG has some of those
cases.
- likely_bad_function_signature: non-declaration function signatures
should have the storage class and type on it's own line, then the
function name at the start of the next line. A common mistake is to
put all on the same line. This rule also doubles to catch function
declarations missing the storage class. This is a warning, not error,
because upstream PG code sometimes fails to comply with this.
Improve the existing likely_bad_brace (now renamed to
likely_bad_opening_brace) rule to not have a useless "else if".
Jira: DB-14371
Test Plan:
Close: #25187
Jenkins: skip
Reviewers: telgersma
Reviewed By: telgersma
Subscribers: telgersma, yql
Differential Revision: https://phorge.dev.yugabyte.com/D40444