def buildScaffold(self, lines, spacingCount, spacingType, usingSpaces):
        """Build an array of lines to output to the file.

        Keyword arguments:
        self -- self
        lines -- the lines read from file or selection
        spacingCount -- the tab/space size being used
        spaingType -- space or tab character to input
        usingSpaces -- current user settings, spaces or tabs
        """
        scaffold = []

        for index, line in enumerate(lines):
            lineText = line.lstrip(spacingType)
            currentWhitespace = self.countLineWhitespace(line, spacingType)

            if index < len(lines) - 1:
                nextWhitespace = self.countLineWhitespace(
                    lines[index + 1], spacingType)
            else:
                nextWhitespace = self.countLineWhitespace(
                    lines[0], spacingType)

            descRepl = self.DESCRIBE_LINE % lineText
            indented = descRepl.rjust(
                len(descRepl) + currentWhitespace, spacingType)

            if currentWhitespace >= nextWhitespace:
                itRepl = self.IT_LINE % lineText
                decreasingWhitespace = currentWhitespace
                itReplIndent = itRepl.rjust(
                    len(itRepl) + currentWhitespace, spacingType)
                indented = []
                indented.append(itReplIndent + '});'.rjust(
                    3 + currentWhitespace, spacingType) + '\n\n')
                while decreasingWhitespace > nextWhitespace:
                    decreasingWhitespace -= spacingCount if usingSpaces else 1
                    closeBrackets = '});'.rjust(
                        3 + decreasingWhitespace, spacingType) + '\n\n'
                    indented.append(closeBrackets)

            scaffold.extend(indented)

        return scaffold
dataset/ETHPy150Open swirlycheetah/jasmine-scaffold-sublime-text/main.py/JasmineScaffoldCommand.buildScaffold/original