#!/bin/bash12# This file is part of t8code.3# t8code is a C library to manage a collection (a forest) of multiple4# connected adaptive space-trees of general element classes in parallel.5#6# Copyright (C) 2023 the developers7#8# t8code is free software; you can redistribute it and/or modify9# it under the terms of the GNU General Public License as published by10# the Free Software Foundation; either version 2 of the License, or11# (at your option) any later version.12#13# t8code is distributed in the hope that it will be useful,14# but WITHOUT ANY WARRANTY; without even the implied warranty of15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16# GNU General Public License for more details.17#18# You should have received a copy of the GNU General Public License19# along with t8code; if not, write to the Free Software Foundation, Inc.,20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.212223# This script checks whether all .c .h .cxx and .hxx24# files in t8code are properly indented.25#26# Returns 0 if yes and not 0 if not.27#2829#30# This script must be executed from the scripts/ folder.31#32if [ `basename $PWD` != scripts ]33then34if [ -d scripts ]35then36# The directory stack is automatically reset on script exit.37pushd scripts/ > /dev/null38else39echo ERROR: scripts/ directory not found.40exit 141fi42fi4344# Find all files with the appropriate suffix.45# Excluding the sc/ and p4est/ subfolders.46files=`./find_all_source_files.sh`4748notallindented=049for file in $files50do51# Find also gives us directories,52# so we ensure that $file is a proper53# file before checking for indentation.54if [ -f $file ]55then56./check_if_file_indented.sh $file > /dev/null 2>&157status=$?58if test $status -ne 059then60echo "File $file is not indented."61notallindented=162fi63fi64done6566if test $notallindented -eq 067then68echo All files are indented.69fi7071exit $notallindented727374