Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122415 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 E33CE1ADA74 for ; Sat, 17 Feb 2024 21:01:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708203689; bh=CXalAP7thqJezmtQ1guz2TGqoM3gY3Z8E5BmPaNwisE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fA841kAokDjLqGx/sJIBIPwqGU/auadgS5ozNlbnGxe7+qWVHtQUg4mt2enB0bI7m m9WufCfcbayDVx127s0vyJqMUy8DR+A9tpuOsTz3xyLu4P/e7wZyFYhTB56oPVKnDS 8vkiIJY9gK5UjErLDPQqGEf0iESqjcDO9h9qVGXID+4/pr2pTakVLbFTXVIUvCuJgE Occbr9yeof8ybrqeUzKCfbom8vKrTZkZtXu7ohpEWWlUV9XTKgIbEVT8aMEj5hPF9f Thu7z3fGhtBQivcI/40oB2SHZIkjixYNvS84NXDTL8uga/NUHDLGy6vDfR55l0laRZ kf/GBvwHp4J9g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CCD981830EB for ; Sat, 17 Feb 2024 21:01:26 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (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 13:01:24 -0800 (PST) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-21e6be74db4so960006fac.2 for ; Sat, 17 Feb 2024 13:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708203681; x=1708808481; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CXalAP7thqJezmtQ1guz2TGqoM3gY3Z8E5BmPaNwisE=; b=I4VgV8ZMm7+xLZrZJ2Xkhp/kP3DZ5Hj5YA/ufRahPZ53zFvN+V3OML7fTzp2qbWk3Q 8yu59WH9GxnApGWDwpE6CRcMKDWgckav+AnRLM3e2QpHsJtstylnJ64rB9BBpkuPVTYG fwdRPB5ImA+I1RssSsGQjOVACs/+UaA8AmcKgn2xO2veyuuqUi32yB3KzfeM1ud0rN0L lct3btzOsmumuUDcVyiyr7ZfsQjrfmyvEGl8ZJh4m2r+Ha10OOsDkVllXIEd0iSbMuVI YpW8L2jYo5ESd2D+phrNfeKeymxdkHyBM5ulehgJQ5zoXtKha8b/2dBlioJ8TYK/sVqM 4EJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708203681; x=1708808481; h=cc: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=CXalAP7thqJezmtQ1guz2TGqoM3gY3Z8E5BmPaNwisE=; b=pa5zs031EXf40836O4d3MtnA/cAOrjhkrkUpW8hKBrkfltVdzE2sz5SDch9w4EtipJ wKiVsKomHANmYrnD7Jk9bwmKx7zuH9SiZk7TGUnNUWZKQ3xYjP9v4cjRvcwEpGE5yOI+ uS0umX/goP3XDIpCXAn2PXOLu1eO9FMDbCAiATFwkPRO50QBHDk7EULpunUU/Q8rjTGv 6vtD1qqY+kxiRdjXoEMbfAyyC0CfWKSES1H7xMdFsUvMvqvKYUiR/fAiqo2UWzw9WlcG 0dAwjtsPyDeuaj/g5xCOCAsvYkHYXhJQTSkTwdRQbM8bnQT9TFBdnFXjLh/kv6WDyHCf ZZ7A== X-Forwarded-Encrypted: i=1; AJvYcCVUeRUlZ8zzLRFYl/vqkTEYCnRzSXg9xTVOQbA3TgNqL4yiehjiI/JBnSAG5SfQxpcMu3A54d7LUhUFAW2qWj8ajRV6qPv+2g== X-Gm-Message-State: AOJu0Yy+vKz7nINc7bOpOeRmm5J+VyXhJ622hK0H8++MqKUPfVTGggOP vi42KmbExnsTjn+TcqpD71idAfabwkH4uG9QZ/KYENyPoheU++nOr8Jq0MEFlgCKRPy4AsVuyZC yTZEoBMep4lgO9chmMm8nczOoWm8HvalLqGA= X-Google-Smtp-Source: AGHT+IHiNHpZsPMp0mEYsa+/1cW62e3aQcst7ZGZGpMJCNChVlDhTG2exlOtsSnRpvQzuSDOCvBj8tFQc1PEeSExbhk= X-Received: by 2002:a05:6870:c685:b0:218:f5f2:a4a0 with SMTP id cv5-20020a056870c68500b00218f5f2a4a0mr8308258oab.59.1708203681442; Sat, 17 Feb 2024 13:01:21 -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 22:01:09 +0100 Message-ID: Subject: Re: [PHP-DEV] automatic formatting checks for pull requests? To: "Gina P. Banyard" Cc: Hans Henrik Bergan , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000a2f2cd06119a29f7" From: divinity76@gmail.com (Hans Henrik Bergan) --000000000000a2f2cd06119a29f7 Content-Type: text/plain; charset="UTF-8" On Sat, Feb 17, 2024, 15:27 Gina P. Banyard wrote: > On Saturday, 17 February 2024 at 11:24, Hans Henrik Bergan < > hans@loltek.net> wrote: > > > Can we add automatic formatting checks for pull requests? > > Made a PR: https://github.com/php/php-src/pull/13417 > > > > php-src use "tabs" instead of "spaces", that is... quite unusual, > > and I'm probably not the first person to accidentally use spaces > > instead of tabs, ref > > > https://github.com/php/php-src/pull/13401/files/d64a8ccdc1d21576827059ee86c0fa073c95ffcc#r1492699756 > > That's quite standard in the C world AFAIK, yes it's not what is standard > for PHP written code but that's kinda irrelevant. > > 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 > understand our codebase (namely macros) and is difficult to set-up for > php-src. > > Best regards, > > Gina P. Banyard > It worked great with the macros I've tested so far: ZEND_PARSE_PARAMETERS_START Z_PARAM_NUMBER ZEND_PARSE_PARAMETERS_END Z_TYPE_P Z_LVAL_P UNEXPECTED ZEND_ASSERT RETURN_DOUBLE RETURN_LONG RETURN_THROWS Is there any specific macros I can test? --000000000000a2f2cd06119a29f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Feb 17, 2024, 15:27 Gina P. Banyard <intern= als@gpb.moe> wrote:
On Saturday,= 17 February 2024 at 11:24, Hans Henrik Bergan <hans@loltek.net> wro= te:

> Can we add automatic formatting checks for pull requests?
> Made a PR: https://github.com/php/php-src= /pull/13417
>
> php-src use "tabs" instead of "spaces", that is...= quite unusual,
> and I'm probably not the first person to accidentally use spaces > instead of tabs, ref
> https://github.com/php/php-src/pull/13401/files/d64a8ccdc1d= 21576827059ee86c0fa073c95ffcc#r1492699756

That's quite standard in the C world AFAIK, yes it's not what is st= andard for PHP written code but that's kinda irrelevant.

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 under= stand our codebase (namely macros) and is difficult to set-up for php-src.<= br>
Best regards,

Gina P. Banyard

It worked great with the macros I've tested so far:
ZEND_PARSE_PARAMETERS_START
Z_PAR= AM_NUMBER
ZEND_PARSE_PARAMETERS_END
Z_TYPE_P
Z_LVAL_P
UNEX= PECTED
ZEND_ASSERT
RETURN_DOU= BLE
RETURN_LONG
RETURN_THROWS=

Is there any specific m= acros I can test?

--000000000000a2f2cd06119a29f7--