Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# under the License.
from __future__ import absolute_import
import argparse
import fileinput
import os
import re
import shlex
import subprocess
import sys
import bashate
from bashate import messages
MESSAGES = messages.MESSAGES
def is_continuation(line):
return re.search('\\\\\s*$', line)
def check_for_do(line, report):
if not is_continuation(line):
match = re.match('^\s*(for|while|until)\s', line)
if match:
operator = match.group(1).strip()
if operator == "for":
# "for i in ..." and "for ((" is bash, but
# "for (" is likely from an embedded awk script,
# so skip it
if re.search('for \([^\(]', line):