Opened 5 months ago

Closed 5 months ago

#30062 closed enhancement (duplicate)

shellcheck all Tor shell scripts

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: shellcheck, tor-scripts, git-scripts
Cc: rl1987 Actual Points:
Parent ID: Points: 3
Reviewer: Sponsor:

Description

make shellcheck checks these scripts:

                find $(top_srcdir)/scripts/ -name "*.sh" -exec shellcheck {} +; \
                if [ -d "$(top_srcdir)/scripts/test" ]; then \
                        shellcheck $(top_srcdir)/scripts/test/cov-diff $(top_builddir)/scripts/test/coverage; \
                fi; \

But it's missing some scripts:

$ grep -r "#\!/bin/" . | grep -v "scripts/.*\.sh:"
# and then manually edited
./contrib/dist/torctl.in:#!/bin/sh
./contrib/dist/rc.subr:#!/bin/sh
./contrib/dist/tor.sh.in:#!/bin/sh
./contrib/dist/suse/tor.sh.in:#!/bin/sh
./contrib/dirauth-tools/nagios-check-tor-authority-cert:#!/bin/bash
./scripts/test/cov-diff:#!/bin/sh
./scripts/test/coverage:#!/bin/sh
./scripts/git/post-merge.git-hook:#!/bin/sh
./scripts/git/pre-push.git-hook:#!/bin/bash
./scripts/git/pre-commit.git-hook:#!/bin/bash
./doc/asciidoc-helper.sh:#!/bin/sh
./autogen.sh:#!/bin/sh
./src/test/test_ntor.sh:#!/bin/sh
./src/test/test_zero_length_keys.sh:#!/bin/sh
./src/test/test_workqueue_pipe.sh:#!/bin/sh
./src/test/test_workqueue_efd2.sh:#!/bin/sh
./src/test/test_rust.sh:#!/bin/sh
./src/test/test_rebind.sh:#!/bin/sh
./src/test/test_key_expiration.sh:#!/bin/sh
./src/test/zero_length_keys.sh:#!/bin/sh
./src/test/test_workqueue_cancel.sh:#!/bin/sh
./src/test/test_switch_id.sh:#!/bin/sh
./src/test/test_workqueue_socketpair.sh:#!/bin/sh
./src/test/test_workqueue_efd.sh:#!/bin/sh
./src/test/test_hs_ntor.sh:#!/bin/sh
./src/test/test_workqueue_pipe2.sh:#!/bin/sh
./src/test/fuzz/fixup_filenames.sh:#!/bin/sh
./src/test/fuzz/minimize.sh:#!/bin/sh
./src/test/test_bt.sh:#!/bin/sh
./src/test/test_keygen.sh:#!/bin/sh
./src/test/fuzz_static_testcases.sh:#!/bin/sh
./src/ext/ed25519/ref10/q2h.sh:#!/bin/sh

Let's gradually shellcheck these scripts, and add them to the Makefile?
We should probably fix each group of scripts in a subticket.

Child Tickets

Change History (1)

comment:1 Changed 5 months ago by rl1987

Resolution: duplicate
Status: newclosed

Duplicate of #29533. Closing.

We need more tickets to clean up remaining shell scripts though.

Note: See TracTickets for help on using tickets.