Skip to content

Trailing white space introduced #43

@peterjc

Description

@peterjc

Tools like flake8 will complain about trailing white space (W291), and it seems pyment sometimes introduces white space.

As a specific example, take the test.py example from the README.rst file which produces the following:

        def func(param1=True, param2='default val'):
            """Description of func with docstring groups style.

            :param param1: descr of param1 that has True for default value
            :param param2: descr of param2 (Default value = 'default val')
            :returns: some value
            :raises keyError: raises key exception
	    :raises TypeError: raises type exception

	    """
            pass

        class A:
            """ """
            def method(self, param1, param2=None):
	        """

	        :param param1:
                :param param2:  (Default value = None)

	        """
                pass

There is a trailing space on the line :param param1: in the class A method, both here and in the patch itself.

I have confirmed this running pyments test.py locally using v0.3.2

Other examples (which I have not reduced to a minimal test case) introduce "blank lines" with the default indentation spaces included. I had a look at the code, but was confused by the multiply defined lambda function with_space which seems might be to blame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions