tarantool / checkpatch

Checkpatch for Tarantool
GNU General Public License v2.0
2 stars 2 forks source link

Fix multiline commit reference check #64

Closed igormunkin closed 1 year ago

igormunkin commented 1 year ago

There was a classic mess with magic numbers implementing multiline commit reference check: the script looks for "commit" keyword preceding the commit hash and the commit subject in so-called "balanced parens". The script was assuming that the whole structure fits into a one or maximum two consequtive lines. However, with 40-symbol hash the whole reference can spread through three lines: commit + 40-symbol hash + up to 50-symbol commit message in parens and quotes. The aforementioned case occur when "commit" keyword is the only part found in the first line and the subject is split into two lines, since the commit hash takes 40 symbols of the 72 available per commit message line (see example here1). Hence, the magic number is simply incremented allowing to use full-length commit hashes in the reference.