LLNL / py-hostlist

hostlist utility implemented in python
MIT License
6 stars 2 forks source link

Extra spaces in hostlist.py on GitHub? #23

Closed cmoussa1 closed 6 years ago

cmoussa1 commented 6 years ago

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.

gonsie commented 6 years ago

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

cmoussa1 commented 6 years ago

Issue was fixed with commit 513cb2ef09abab195b97519d288c54f7629cc665