From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id F40F129FBB for ; Fri, 17 Aug 2018 05:28:41 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GTwZQQEV9vvu for ; Fri, 17 Aug 2018 05:28:41 -0400 (EDT) Received: from smtp15.mail.ru (smtp15.mail.ru [94.100.176.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id AD4A129FB7 for ; Fri, 17 Aug 2018 05:28:41 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 2/2] sql: remove GLOB from Tarantool References: <4607dc428909e96915e9f0984a7733a0890a3185.1534436836.git.n.tatunov@tarantool.org> <76466086-2a5f-8f12-cbc3-4ddf26e30fd9@tarantool.org> <4137B8ED-FBEF-4B41-A84F-83AB8F75D0D6@tarantool.org> <193c5885-f295-9753-573e-aa4ae1bd7e89@tarantool.org> From: Alex Khatskevich Message-ID: <2898df84-5770-244b-6491-c35deca46d37@tarantool.org> Date: Fri, 17 Aug 2018 12:28:37 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: "n.pettik" , tarantool-patches@freelists.org Cc: Alexander Turenko , "N. Tatunov" On 17.08.2018 12:20, n.pettik wrote: >> On 17 Aug 2018, at 12:01, Alex Khatskevich wrote: >> >> On 17.08.2018 11:49, n.pettik wrote: >>>> On 17 Aug 2018, at 11:25, Alex Khatskevich wrote: >>>> >>>> Do not split error messages at the middle of a sentence. It makes errors ungreppable. >>>> Make it <80 somehow different. >>> I guess this is extremely specific nitpicking: look at src/box/alter.cc: >>> through the code there are a lot of breaks of error messages like: >>> >>> alter.c : 405 >>> >>> tnt_raise(ClientError, errcode, tt_cstr(space_name, name_len), >>> tt_sprintf("field %d has conflicting nullability and " >>> "nullable action properties", fieldno + >>> TUPLE_INDEX_BASE)); >>> >>> alter.cc : 524 >>> >>> if (exact_field_count != 0 && >>> exact_field_count < field_count) { >>> tnt_raise(ClientError, errcode, tt_cstr(name, name_len), >>> "exact_field_count must be either 0 or >= "\ >>> "formatted field count”); >>> >>> etc >> That is not a good example of code. > Okay, then look at key_def.c and other source files. I can’t find example of breaking > 80 chars border with error string message. Thus, I guess this rule is unlikely to be > supported within our codestyle. > >> If possible, error message should not be broken at the middle. >> In my opinion, even if it is not possible, it should better be > 80. >> >> Linus is for this https://www.kernel.org/doc/html/v4.10/process/coding-style.html > > As I said, I do not ask anyone to break the 80 rule. I ask to do not split the error message. it can be done that way for example: ```         const char * const err_msg =             "ESCAPE expression must be a single character";         if (sqlite3Utf8CharLen((char *)zEsc, -1) != 1) {             sqlite3_result_error(context,                          err_msg,                          -1);             return; ```