]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Align and fix indentations in several maint scripts
authorskaluzka <skaluzka@protonmail.com>
Tue, 7 Sep 2021 21:44:44 +0000 (23:44 +0200)
committerskaluzka <skaluzka@protonmail.com>
Tue, 7 Sep 2021 21:44:44 +0000 (23:44 +0200)
Use 4 spaces indentations, convert tabs to spaces.
No real code changes.

scripts/maint/checkOptionDocs.pl.in
scripts/maint/checkSpace.pl
scripts/maint/check_config_macros.pl
scripts/maint/findMergedChanges.pl
scripts/maint/gen_ccls_file.sh
scripts/maint/run_calltool.sh
scripts/maint/updateRustDependencies.sh

index bb8008c2e8012300bc1da58a8c6dca47ca974ed1..2d4a7884f54dcbb2ee82cb4786af004f955ec7d1 100644 (file)
@@ -43,7 +43,7 @@ open(F, "@abs_top_srcdir@/doc/man/tor.1.txt") or die;
 while (<F>) {
     if (m!^(?:\[\[([A-za-z0-9_]+)\]\] *)?\*\*([A-Za-z0-9_]+)\*\*!) {
         $manPageOptions{$2} = 1;
-       print "Missing an anchor: $2\n" unless (defined $1 or $2 eq 'tor');
+        print "Missing an anchor: $2\n" unless (defined $1 or $2 eq 'tor');
     }
 }
 close F;
index 857ce6f6f107f7f3e42681f73acc65a5baaa6b12..8ecbf414cf3a8486d4ff73242acb2d233fc33d06 100755 (executable)
@@ -7,13 +7,13 @@ my $found = 0;
 my $COLON_POS = 10;
 
 sub msg {
-  $found = 1;
-  my $v = shift;
-  $v =~ /^\s*([^:]+):(.*)$/;
-  chomp(my $errtype = $1);
-  my $rest = $2;
-  my $padding = ' ' x ($COLON_POS - length $errtype);
-  print "$padding$errtype:$rest\n";
+    $found = 1;
+    my $v = shift;
+    $v =~ /^\s*([^:]+):(.*)$/;
+    chomp(my $errtype = $1);
+    my $rest = $2;
+    my $padding = ' ' x ($COLON_POS - length $errtype);
+    print "$padding$errtype:$rest\n";
 }
 
 my $C = 0;
index bcde2beccc92eb755b448962a075a6c32864e905..1398b9984a99022e40cdb151b82300bb348ebd73 100755 (executable)
@@ -7,7 +7,7 @@ my @macros = ();
 open(F, 'orconfig.h.in');
 while(<F>) {
     if (/^#undef +([A-Za-z0-9_]*)/) {
-       push @macros, $1;
+        push @macros, $1;
     }
 }
 close F;
@@ -15,6 +15,6 @@ close F;
 for my $m (@macros) {
     my $s = `git grep '$m' src`;
     if ($s eq '') {
-       print "Unused: $m\n";
+        print "Unused: $m\n";
     }
 }
index 9b3496403d6762e0d810a64bca42f5d45d382e20..427f2b111dcdfaa9c3df94e84a632bca7d8530ec 100755 (executable)
@@ -9,7 +9,7 @@ sub nChanges {
     # requires perl 5.8.  Avoids shell issues if we ever get a changes
     # file named by the parents of Little Johnny Tables.
     open F, "-|", "git", "log", "--no-merges", "--pretty=format:%H", $branches, "--", $fname
-       or die "$!";
+        or die "$!";
     my @changes = <F>;
     return scalar @changes
 }
@@ -42,13 +42,13 @@ my $head = "origin/main";
 while (@ARGV and $ARGV[0] =~ /^--/) {
     my $flag = shift @ARGV;
     if ($flag =~ /^--(weird|merged|unmerged|list)/) {
-       $look_for_type = $1;
+        $look_for_type = $1;
     } elsif ($flag =~ /^--branch=(\S+)/) {
         $target_branch = $1;
     } elsif ($flag =~ /^--head=(\S+)/) {
         $head = $1;
     } else {
-       die "Unrecognized flag $flag";
+        die "Unrecognized flag $flag";
     }
 }
 
@@ -58,16 +58,16 @@ for my $changefile (@ARGV) {
     my $type;
 
     if ($n_merged != 0 and $n_postmerged == 0) {
-       $type = "merged";
+        $type = "merged";
     } elsif ($n_merged == 0 and $n_postmerged != 0) {
-       $type = "unmerged";
+        $type = "unmerged";
     } else {
-       $type = "weird";
+        $type = "weird";
     }
 
     if ($type eq $look_for_type) {
-       print "$changefile\n";
+        print "$changefile\n";
     } elsif ($look_for_type eq 'list') {
-       printf "% 8s: %s\n", $type, $changefile;
+        printf "% 8s: %s\n", $type, $changefile;
     }
 }
index b1fa55c97301490d8dbe9e8c626d90771a17b2f0..04e31d22a82d22e1314681ee077ba371d77e41ac 100755 (executable)
@@ -19,13 +19,13 @@ echo "clang" > "$CCLS_FILE"
 # Add these include so the ccls server can properly check new files that are
 # not in the compile_commands.json yet
 {
-  echo "-I."
-  echo "-I./src"
-  echo "-I./src/ext"
-  echo "-I./src/ext/trunnel"
+    echo "-I."
+    echo "-I./src"
+    echo "-I./src/ext"
+    echo "-I./src/ext/trunnel"
 } >> "$CCLS_FILE"
 
 # Add all defines (-D).
 for p in $PRIVATE_DEFS; do
-  echo "-D$p" >> "$CCLS_FILE"
+    echo "-D$p" >> "$CCLS_FILE"
 done
index b0268322f4a7534c985b4a44cd2e9a0418e8dc38..025a49cd0397f2ab13df3b59c2ce6aaf26c60d38 100755 (executable)
@@ -5,8 +5,8 @@
 set -e
 
 if test "x$CALLTOOL_PATH" != "x"; then
-  PYTHONPATH="${CALLTOOL_PATH}:${PYTHONPATH}"
-  export PYTHONPATH
+    PYTHONPATH="${CALLTOOL_PATH}:${PYTHONPATH}"
+    export PYTHONPATH
 fi
 
 mkdir -p callgraph
@@ -14,8 +14,8 @@ mkdir -p callgraph
 SUBITEMS="fn_graph fn_invgraph fn_scc fn_scc_weaklinks module_graph module_invgraph module_scc module_scc_weaklinks"
 
 for calculation in $SUBITEMS; do
-  echo "======== $calculation"
-  python -m calltool "$calculation" > callgraph/"$calculation"
+    echo "======== $calculation"
+    python -m calltool "$calculation" > callgraph/"$calculation"
 done
 
 cat <<EOF > callgraph/README
index 6d0587351f8afadf0a103926f4fee6b00fab5e05..e37a6336751ee16129dd797dcc68bdef2ff0eef2 100755 (executable)
@@ -26,7 +26,7 @@ TOML="$TOPLEVEL/src/rust/Cargo.toml"
 VENDORED="$TOPLEVEL/src/ext/rust/crates"
 CARGO=$(command -v cargo)
 
-if ! test -f "$TOML"  ; then
+if ! test -f "$TOML" ; then
     printf "Error: Couldn't find workspace Cargo.toml in expected location: %s\\n" "$TOML"
 fi