Skip to content

Handle trailing whitespace in test .exp files using regexp syntax #19068

@dhalbert

Description

@dhalbert

Description

#13777, accomplished by dda9b9c removed trailing whitespace from nearly all the source files,, but had to skip doing so with the test .exp files.

I am currently merging MicroPython v1.27 into CircuitPython. I have my editor set up to remove trailing whitespace, and was stymied by my editor's behavior when I had to edit a number of *.py.exp files in tests/cmdline with trailing whitespace, for use with CircuitPython.

Rather than switch editors or turn off the trailing-whitespace removal temporarily, I realized that I could use the regexp capability used in the .exp files to remove the literal trailing whitespace, by using the \$ construct following the whitespace. For example, if there is trailing whitespace like >>> (one space after the prompt), you can instead do >>> \$. Then you don't have to handle the .exp files in a special way either when you edit them yourself or when any trailing whitespace is pruned automatically.

Code Size

There is no effect on code size.

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationstestsRelates to tests/ directory in source

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions