From 2d97ce51ec18110c43b464dc508f8636eb7f358e Mon Sep 17 00:00:00 2001 From: fengzero Date: Mon, 7 Mar 2022 06:28:41 +0000 Subject: [PATCH] del etc dir --- etc/format-check.sh | 94 --------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100755 etc/format-check.sh diff --git a/etc/format-check.sh b/etc/format-check.sh deleted file mode 100755 index 68b3d8eb..00000000 --- a/etc/format-check.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -# -# Copyright 2016 Garrett D'Amore -# -# This software is supplied under the terms of the MIT License, a -# copy of which should be located in the distribution where this -# file was obtained (LICENSE.txt). A copy of the license may also be -# found online at https://opensource.org/licenses/MIT. -# - -# -# This script is used to run uncrustify and report files that don't match. -# It looks for .c and .h files, located in ../src, and uses the config file -# uncrustify.cfg located in the same directory as this script. It only handles -# C language at this point. -# -CLANG_FORMAT=${CLANG_FORMAT:-clang-format} -case "${CLANG_FORMAT}" in -no|off|skip|NO|OFF|SKIP) - echo "format checks skipped" - exit 0 - ;; -esac -mydir=$(dirname $0) -srcdir=${mydir}/../src -failed= - -vers=$(${CLANG_FORMAT} -version) -if [ $? -ne 0 ]; then - echo "clang format not found? Skipping checks." - exit 0 -fi - -versno=${vers#clang-format version } -prefix=${vers%${versno}} - -if [ "$prefix" != "clang-format version " ] -then - echo "clang-format version misparsed. Skipping checks." - exit 0 -fi - -# strip off any -ubuntu suffix -versno=${versno%%-*} -maj=${versno%%.*} -rem=${versno#*.} -min=${rem%%.*} - -if [ "${maj}" -lt 3 ]; then - echo "clang-format is too old. Skipping checks." - exit 0 -fi -if [ "${maj}" -eq 3 -a "${min}" -lt 6 ]; then - echo "clang-format is too old. Skipping checks." - exit 0 -fi - - -mytmpdir=$(mktemp -d) - -diffprog=${DIFF:-diff} -if [ -t 1 ]; then - if colordiff -q /dev/null > /dev/null 2>&1; then - diffprog=${DIFF:-colordiff} - fi -fi - -cd ${srcdir} -for file in $(find . -name '*.[ch]' -print) -do - ext=${file##*.} - oldf=${file} - newf=${mytmpdir}/new.${ext} - # If we do not understand the format file, then do nothing - # Our style requires a relatively modern clang-format, which is - # older than is found on some Linux distros. - ${CLANG_FORMAT} -fallback-style=none -style=file ${oldf} > ${newf} - cmp -s ${oldf} ${newf} - if [ $? -ne 0 ] - then - echo "${file} style changes" - ${diffprog} -u $oldf $newf - failed=1 - fi -done -rm -rf $mytmpdir -if [ -n "$failed" ] -then - echo "Format differences found!" 1>&2 - # Sadly, there are different versions of Uncrustify, and they don't - # seem to universally agree. So let's not trigger a build error on - # this -- but instead just emit it to standard output. - exit 0 -fi