From patchwork Tue Aug 5 16:59:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4357 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6302:b0:671:5a2c:6455 with SMTP id a2csp2127995maf; Tue, 5 Aug 2025 09:59:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpACcDQxeXrZdQuf2BcD+iEUMH4/Fe1XjVRUKetYoc+wNAkVXBd80jdo8FtRK+7Yoq0T37NIO85q0=@openvpn.net X-Google-Smtp-Source: AGHT+IH0C56pg9+qlWf/PJJZZKi9me8UbvIf2GZUZ8CNFloBtrQqIIVkKrkRjP90Gz+lNq1hYD2G X-Received: by 2002:a05:6871:9f14:b0:30b:c70e:e514 with SMTP id 586e51a60fabf-30bc70eea88mr1599754fac.8.1754413189696; Tue, 05 Aug 2025 09:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1754413189; cv=none; d=google.com; s=arc-20240605; b=Y/1KeLxZkgukhynt4wh5OHKva8S5iehsAF6YYyWG5DwA91aJ1FAdMXFCvPkIF3nBVj l+67IEAh+S5CWE1WMY0/R68N84ZpDC5fnjuRVlOfVjj8aHNd+dpeK/TovTCeNczNzqsm c8txSmMWb+xxiFfhs3t8IQyDTwS03uGitHWF8Mh+Piy5p2oYfQuUPosEHecs7cD5U8s3 kGjmhPo8A43EYhBt8JBS6jvx/EbJJgOqBlePjC2jHK6wzInj55abcJU0MzuVbkh1Azu0 X7EjKlNHDuHsGgakXQ5jwklOxJZQi48NzGgYPQLdIiVIvyRjlj7fMQMaHqhAire6hE9M TOZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=+K0ya+nZv0qHzDN56w8ZDP0ZS9wuDUatAfzGbpNQIQY=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Md//572BQG+pf//pxRgmOKBRxbhuYCsIRffraw5jGqBF8DEaXc8LGjOIHWM45GVRML CZPU45dPaivBwZ8yXn00LmBQvDFkGzfP/YaEueFBbwdSOsB1C87OvEL5hjW5sn4EB0iB EckThuu17/+4HtdGfuo8LHGdoPg9b+F7j1d/6WUmAqTb8E8cMaognneI22VWD9sjOkzy 20YgIfIK/jNqBodcoBbVNvAxqIAM9/waf/S9hEScpLuXoxNozU6dUYz3mCzleqE+m1X4 Kx6WIL28QgB5AykUPsCx1nDCAF5/jNumV5RYpeSnSVxc+mmVVbjuYKivZTgD2rpEIu/m n4ig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=cMsutFA2; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OFu5KEy3; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kW28Ozyz; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-30b5e5a7ec1si2468990fac.53.2025.08.05.09.59.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Aug 2025 09:59:49 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=cMsutFA2; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OFu5KEy3; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kW28Ozyz; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+K0ya+nZv0qHzDN56w8ZDP0ZS9wuDUatAfzGbpNQIQY=; b=cMsutFA2Cl3defFymL3sCew0cT B+CPuPKXQo3kBXiXsVyH6e9/UBC55Xn5ZML/ZX5z7w/pNMkVvSy1jJ9iCMh5j0TYlM3yxfar19jlS auExtF1g+bqQcu3sFDt/uNUZRY8qZ/d1zhLtupbTwxN4aAD2/JQ20Cs3+ndybcqAVDrs=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1ujL0r-0002FY-Cz; Tue, 05 Aug 2025 16:59:45 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ujL0S-0002FC-Hk for openvpn-devel@lists.sourceforge.net; Tue, 05 Aug 2025 16:59:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q0feh97VPMyrLMf0k0bke/Ndq4O14oWU7zYwMGeXQeo=; b=OFu5KEy3VstjYpQTCSol+6i/WS WyS/nyYl/XwPL6itlNLSSiYUl3IGFCgOtLevh0h8AOZm1EyfT3vlnvObRbfdXVEoq+7r33n6OoJz3 g+wWnKbybsZhZj5s4ZLio8J4GIteesF/Kvm/mk73Hdx/67IYlPoJ+APbe5ZPjtLapTbA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Q0feh97VPMyrLMf0k0bke/Ndq4O14oWU7zYwMGeXQeo=; b=kW28OzyzJVCpCPxvCmYHAneu72 bPXm2SCcXFEYFl1KYzCeoh+miFpl50MDHpeRioEmiOxCyghkp+ISbHPS7wIYyP512ayqwMuKwL15X VSLCuIhih2BrAzoU1GYRpaCERU/yKTbNYz1R06cMOm0U6D7c5Vrwg1Uu1EgFonAVv1Jo=; Received: from [193.149.48.143] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1ujL0R-0007wk-8x for openvpn-devel@lists.sourceforge.net; Tue, 05 Aug 2025 16:59:20 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 575Gx7tB030034 for ; Tue, 5 Aug 2025 18:59:07 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 575Gx6cc030033 for openvpn-devel@lists.sourceforge.net; Tue, 5 Aug 2025 18:59:06 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 5 Aug 2025 18:59:00 +0200 Message-ID: <20250805165906.30010-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld Replaced with clang-format. Change-Id: I15d4946800cbfaead67a73450ff3b12193814e54 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1ujL0R-0007wk-8x Subject: [Openvpn-devel] [PATCH v16] Remove uncrustify config and reformat-all.sh X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1839635565072606148?= X-GMAIL-MSGID: =?utf-8?q?1839635565072606148?= From: Frank Lichtenheld Replaced with clang-format. Change-Id: I15d4946800cbfaead67a73450ff3b12193814e54 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/830 This mail reflects revision 16 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/dev-tools/reformat-all.sh b/dev-tools/reformat-all.sh deleted file mode 100755 index 0a31a83..0000000 --- a/dev-tools/reformat-all.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/sh -# reformat-all.sh - Reformat all git files in the checked out -# git branch using uncrustify. -# -# Copyright (C) 2016-2025 - David Sommerseth -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# - -tstamp="$(date +%Y%m%d-%H%M%S)" -files="$(pwd)/reformat-all_files-$tstamp.lst" -log="$(pwd)/reformat-all_log-$tstamp.txt" - -srcroot="$(git rev-parse --show-toplevel)" -cfg="$srcroot/dev-tools/uncrustify.conf" -specialfiles="$srcroot/dev-tools/special-files.lst" - -export gitfiles=0 -export procfiles=0 - -# Go to the root of the source tree -cd "$srcroot" - -{ - echo -n "** Starting $0: " - date - - # Find all C source/header files - git ls-files | grep -E ".*\.[ch](\.in$|$)" > "${files}.git" - - # Manage files which needs special treatment - awk -F\# '{gsub("\n| ", "", $1); print $1}' "$specialfiles" > "${files}.sp" - while read srcfile - do - res=$(grep "$srcfile" "${files}.sp" 2>/dev/null) - if [ $? -ne 0 ]; then - # If grep didn't find the file among special files, - # process it normally - echo "$srcfile" >> "$files" - else - mode=$(echo "$res" | cut -d: -f1) - case "$mode" in - E) - echo "** INFO ** Excluding '$srcfile'" - ;; - P) - echo "** INFO ** Pre-patching '$srcfile'" - patchfile="${srcroot}"/dev-tools/reformat-patches/before_$(echo "$srcfile" | tr "/" "_").patch - if [ -r "$patchfile" ]; then - git apply "$patchfile" - if [ $? -ne 0 ]; then - echo "** ERROR ** Failed to apply pre-patch file: $patchfile" - exit 2 - fi - else - echo "** WARN ** Pre-patch file for $srcfile is missing: $patchfile" - fi - echo "$srcfile" >> "${files}.postpatch" - echo "$srcfile" >> "$files" - ;; - *) - echo "** WARN ** Unknown mode '$mode' for file '$srcfile'" - ;; - esac - fi - done < "${files}.git" - rm -f "${files}.git" "${files}.sp" - - # Kick off uncrustify - echo - echo "** INFO ** Running: uncrustify -c $cfg --no-backup -l C -F $files" - uncrustify -c "$cfg" --no-backup -l C -F "$files" 2>&1 - res=$? - echo "** INFO ** Uncrustify completed (exit code $res)" -} | tee "${log}-1" # Log needs to be closed here, to be processed in next block - -{ - # Check the results - gitfiles=$(wc -l "$files" | cut -d\ -f1) - procfiles=$(grep "Parsing: " "${log}-1" | wc -l) - echo - echo "C source/header files checked into git: $gitfiles" - echo "Files processed by uncrustify: $procfiles" - echo - - # Post-Patch files modified after we uncrustify have adjusted them - if [ -r "${files}.postpatch" ]; then - while read srcfile; - do - patchfile="${srcroot}"/dev-tools/reformat-patches/after_$(echo "$srcfile" | tr "/" "_").patch - if [ -r "$patchfile" ]; then - echo "** INFO ** Post-patching '$srcfile'" - git apply "$patchfile" - if [ $? -ne 0 ]; then - echo "** WARN ** Failed to apply $patchfile" - fi - else - echo "** WARN ** Post-patch file for $srcfile is missing: $patchfile" - fi - done < "${files}.postpatch" - rm -f "${files}.postpatch" - fi -} | tee "${log}-2" # Log needs to be closed here, to be processed in next block - -cat "${log}-1" "${log}-2" > "$log" - -{ - ec=1 - echo - if [ "$gitfiles" -eq "$procfiles" ]; then - echo "Reformatting completed successfully" - ec=0 - else - last=$(tail -n1 "${log}-1") - echo "** ERROR ** Reformating failed to process all files." - echo " uncrustify exit code: $res" - echo " Last log line: $last" - echo - fi - rm -f "${log}-1" "${log}-2" -} | tee -a "$log" -rm -f "${files}" - -exit $ec diff --git a/dev-tools/special-files.lst b/dev-tools/special-files.lst deleted file mode 100644 index e5f2fc2..0000000 --- a/dev-tools/special-files.lst +++ /dev/null @@ -1,5 +0,0 @@ -E:doc/doxygen/doc_key_generation.h # @verbatim section gets mistreated, exclude it -E:src/compat/compat-lz4.c # Preserve LZ4 upstream formatting -E:src/compat/compat-lz4.h # Preserve LZ4 upstream formatting -E:src/openvpn/ovpn_dco_linux.h # Preserve ovpn-dco upstream formatting -E:src/openvpn/ovpn_dco_win.h # Preserve ovpn-dco-win upstream formatting diff --git a/dev-tools/uncrustify.conf b/dev-tools/uncrustify.conf deleted file mode 100644 index 325f310..0000000 --- a/dev-tools/uncrustify.conf +++ /dev/null @@ -1,79 +0,0 @@ -# Use Allman-style -indent_columns=4 -indent_braces=false -indent_else_if=false -indent_switch_case=4 -indent_label=1 -nl_if_brace=add -nl_brace_else=add -nl_elseif_brace=add -nl_else_brace=add -nl_else_if=remove -nl_for_brace=add -nl_while_brace=add -nl_switch_brace=add -nl_fdef_brace=add -nl_do_brace=add -sp_func_proto_paren=Remove -sp_func_def_paren=Remove -sp_func_call_paren=Remove -sp_sizeof_paren=Remove - -# No tabs, spaces only -indent_with_tabs=0 -align_with_tabs=false -cmt_convert_tab_to_spaces=true - -# Do not put spaces between the # and preprocessor statements -pp_space=remove - -# Various whitespace fiddling -sp_assign=add -sp_before_sparen=add -sp_inside_sparen=remove -sp_cond_colon=add -sp_cond_question=add -sp_bool=add -sp_else_brace=add -sp_brace_else=add -sp_after_comma=add -pos_arith=Lead -pos_bool=Lead -nl_func_type_name=add -nl_before_case=true -nl_assign_leave_one_liners=true -nl_enum_leave_one_liners=true -nl_brace_fparen=add -nl_max=4 -nl_after_func_proto=2 -nl_end_of_file_min=1 -nl_end_of_file=force - -# Always use scoping braces for conditionals -mod_full_brace_if=add -mod_full_brace_if_chain=false -mod_full_brace_while=add -mod_full_brace_for=add -mod_full_brace_do=add - -# Annotate #else and #endif statements -mod_add_long_ifdef_endif_comment=20 -mod_add_long_ifdef_else_comment=5 - -# Misc cleanup -mod_remove_extra_semicolon=true - -# leave blank at end of empty for() statements -sp_after_semi_for_empty=Add - -# Use C-style comments (/* .. */) -cmt_c_nl_end=true -cmt_star_cont=true -cmt_cpp_to_c=true - -# Use "char **a"-style pointer stars/dereferences -sp_before_ptr_star=Add -sp_between_ptr_star=Remove -sp_after_ptr_star=Remove -sp_before_byref=Add -sp_after_byref=Remove