Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122417 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 39F1F1B17B9 for ; Sat, 17 Feb 2024 22:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708208318; bh=7+yqs0P7YK1YuArURq+/ddO8DgHxjhF0+P6K7U7OsQo=; h=References:In-Reply-To:From:Date:Subject:To:From; b=nqoXQTr2jo6d4y6CST7TBaksO/YCjajwXUeZLGRyiVGNo/L9x7qdIdCtA9xOc1zrm AxrwhDF4owdtmKvgYf3cMyMm72/Dh33fN1+4zgNy1vZIaGobrwMdgxoWV3fJNuWCgE xJ65obzNCldldi8tq0YTrErTh0HBNucwHTyBIbGyBqciUcSeAN19hNeu+P4xXzWS7g dapO5zOxnf0hlYfmVYUhK2lk56JuM5esMYMBuKfbTyRfu3BZRYFRawun7C+klMJKpj UkU+apqI8VM7zhkEakQb1KVKZ+kmvQ8+uKWrXszc6c6Rk1qIDnjd+nPANKqV8rpDy+ RptdFGGm9iKeA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F0B0A180FA4 for ; Sat, 17 Feb 2024 22:18:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 17 Feb 2024 14:18:20 -0800 (PST) Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-68f43d70b99so4955246d6.2 for ; Sat, 17 Feb 2024 14:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708208296; x=1708813096; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7+yqs0P7YK1YuArURq+/ddO8DgHxjhF0+P6K7U7OsQo=; b=fzENvHb3MDIsPsOu4jBWLtrG678PcvPZKgHK7eI4wFyaV3yBrlAFJTXxTVmb/YfQNj Ixr1D92Gbw6LqeG6htz6CNLqczUon6uXFPs2orYUWsorzEPsoJ9wrjBUTC91Zi4MJCYp Xa+tSX7q0k6cjPcqBStARm4TNKkmuqoWXypdZdEocc/RratM4SNBwjCtcdyjiw3VVMdS swfUv3TnRNbfTl8W3hQXiofMsJsxttlfFvHjl0hUO1yieA3U9LTQ1u1bl7clmfXwN/07 0w8K/Uoo2Pc5LvAOC36yraAg620LR9tPYU3tli8GiU3ujOLoCMViniRRCPVyCzbWPpN3 1XAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708208296; x=1708813096; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7+yqs0P7YK1YuArURq+/ddO8DgHxjhF0+P6K7U7OsQo=; b=bycB9lJXwrcOjwwzTxMKlzQcAf9usz6w30ABWLwnXE7bvGWJsrQyO3TdoCWipLmEic 8ctTIoqMo/lrDpaEFHB5fZQ/839WvCt++QwXncUtt9Cuyc9MV010sW9cQvPl4pH9IBw3 x5m9QnXGrPfEc+ofTIRmaCqzFjPrR2eEcdDO5h5FJbpvEjn0gXCjROa3p9LocVlo/iyU vxLCYaSh4tISH1hNf6qKn4MLUfspCT9KpfZPNxMQvo29P4CaDjatbOO1ul6JoMRTApgH +Mgw3tRMcJ+PWhJQtC3m1YS1X9JErjT977YdrcTBYcTq5jRIZEHJMXe+DYdpiLgyX7wE Lpfg== X-Gm-Message-State: AOJu0YyUNaJLGX4P9G1/5A0cwKx6ajxwJv5WHk0x9aPcKc+Gjpfan3kl 0BarMIpex5yc0XYTJqXbNRBGcy8jT4up4XWSS8l2z1nf4B0SDHFfGwCO68qaDemB2tt8LA2twy7 QbLxqdjqwwZgfsyigldXSR+Jpwj7jyR5skto1ww== X-Google-Smtp-Source: AGHT+IEz6vt/ASdH+iihVerpNG6z52JNO3Rk8pql1B6kLFTike6pmpi3KSJTnbg4RV+G0JasuuKWyl0JnWAcBSAjidU= X-Received: by 2002:a0c:cb8a:0:b0:68f:441b:66ea with SMTP id p10-20020a0ccb8a000000b0068f441b66eamr2612674qvk.26.1708208296235; Sat, 17 Feb 2024 14:18:16 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 17 Feb 2024 23:18:05 +0100 Message-ID: Subject: Re: [PHP-DEV] automatic formatting checks for pull requests? To: PHP Internals List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Hans On Sat, Feb 17, 2024 at 3:31=E2=80=AFPM Gina P. Banyard = wrote: > > On Saturday, 17 February 2024 at 11:24, Hans Henrik Bergan wrote: > > > Can we add automatic formatting checks for pull requests? > > Made a PR: https://github.com/php/php-src/pull/13417 > > It would be nice to have some formatting rules to harmonize the codebase = as it is somewhat the wild west, > but as far as my understanding goes is that Clang format struggles to und= erstand our codebase (namely macros) and is difficult to set-up for php-src= . Right. Consistent code style is nice, but what we have now is really not that bad. There are a couple things I'd want if we enforce code style: * Fixing the style should be easy, running a single command without first pushing to CI. * It should be fast too, so that I can easily run it for every commit, preferably even on-save in my editor. * The new code style should be applied only to newly added sections or changed code, not entire files. Otherwise, we'll have many changes in large files, with endless merge conflicts when merging up from lower branches. * The formatting tool should work for all php-src code, not just plain C code. We don't want to be forced to refactor old macros just because we need to add a single line to some long-standing code. Last time I tried clang-format, it utterly failed with our macros. I haven't looked at your PR in detail, so I'm not sure which of these points it satisfies. It would be great if you could quickly describe how it works, and what the goals are. Essentially, I'm just sceptical that this isn't more trouble than it's wort= h. Ilija