[Tarantool-patches] [PATCH v2 1/3] test: corrected reported error lines

Igor Munkin imun at tarantool.org
Tue Jun 29 19:21:05 MSK 2021


Timur,

On 28.06.21, Timur Safin wrote:
> 
> : From: Igor Munkin <imun at tarantool.org>
> : Subject: Re: [Tarantool-patches] [PATCH v2 1/3] test: corrected reported
> : error lines
> : 
> : Timur,
> : 
> : Thanks for the patch! Though the change is quite trivial, the patch is
> : not OK right from the top. Please adjust the commit subject according to
> : our contribution guidelines[1].
> 
> Much thanks Sasha for his useful proposal, not thanks to Igor for useless
> referring to guidelines without suggestion.

Sorry, my bad. If you need a suggestion, here you are: re-read our
contribution guidelines, especially the following bullet:
| Use the imperative mood in the subject line. A properly formed Git
| commit subject line should always be able to complete the following
| sentence: "If applied, this commit will /your subject line here/".

> 

<snipped>

> : 
> : Minor: Strictly saying :123 part is also broken. 
> 
> O_o, why? Could you please clarify? We report it as line number in the 
> source file, in this case tkt-9a8b09f8e6.test.lua:123 was exactly the
> caller location?

Do you need the location of definition (:123) or location where the
function execution is stopped at the moment (:142)? If I got your point,
you prefer the latter, right?

> 

<snipped>

> : > diff --git a/src/lua/tap.lua b/src/lua/tap.lua
> : > index 346724d84..77fd8d096 100644
> : > --- a/src/lua/tap.lua
> : > +++ b/src/lua/tap.lua
> : > @@ -23,7 +23,7 @@ local function traceback(level)
> : >          local frame = {
> : >              source = info.source;
> : >              src = info.short_src;
> : > -            line = info.linedefined or 0;
> : > +            line = info.currentline or info.linedefined or 0;
> : 
> : Why did you leave such a complex code here? I believe you can use just
> : info.currentline here.
> 
> Just in case :)

Nice reasoning :)

> if currentline may be missing in the traceback object for any reason.

It may not, considering the flags used for obtaining debug info.

> If it's impossible for the set of requested flags, then I'll get rid
> of linedefined here.

Yes, <currentline> field is provided by 'l' flag[1]. Please, get rid of
<linedefined> and the default 0 and drop a few sentences regarding this
change in commit message.

> 
> : : [1]: :
> https://www.tarantool.io/en/doc/latest/dev_guide/developer_guidelines/#how-
> : to-write-a-commit-message : : -- : Best regards, : IM
> 
> Thanks, Timur
> 

[1]: https://www.lua.org/manual/5.1/manual.html#lua_getinfo

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list