LLNL/py-hostlist

Extra spaces in hostlist.py on GitHub?

cmoussa1 opened this issue · 2 comments

I am wondering if this is a bug within GitHub. In hostlist.py, there seems to be an extra set of 4 spaces for the methods when viewing the file. For example:

def append_hostname(machine_name, num_list):
        """
        Helper method to append the hostname to node numbers.

        :param machine_name: The name of the cluster.
        :param num_list: The list of nodes to be appended to the cluster name.
        :return: A hostlist string with the hostname and node numbers.
        """

        hostlist = []
        for elem in num_list:
	        hostlist.append(machine_name + str(elem))

        return '%s' % ','.join(map(str, hostlist))

However, when pulling the repo down and viewing the file in a text editor (both Sublime and Atom), there is a correct amount of spaces:

def append_hostname(machine_name, num_list):
    """
    Helper method to append the hostname to node numbers.

    :param machine_name: The name of the cluster.
    :param num_list: The list of nodes to be appended to the cluster name.
    :return: A hostlist string with the hostname and node numbers.
    """

    hostlist = []
    for elem in num_list:
	hostlist.append(machine_name + str(elem))

    return '%s' % ','.join(map(str, hostlist))

Not sure why this is occurring, but will look into it.

Looking at master, those appear to be tabs not 4 spaces. You editors (sublime and atom) are probably set to display a tab as 4 spaces, while GitHub displays them as 6 spaces. There is probably a whitespace mode available that will make it obvious if you are looking at tabs or spaces. Here is what emacs whitespace-mode shows me:
screen shot 2018-07-30 at 10 11 57 am

Issue was fixed with commit 513cb2e