Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all leading $ not just one #1039

Closed
wants to merge 0 commits into from

Conversation

theslimshaney
Copy link
Contributor

@theslimshaney theslimshaney commented Feb 8, 2020

Related to #996

This way we can give less fucks if we have more $

Before

>>> "$ $ echo hello world".replace("$", "", 1).strip()
'$ echo hello world'

After

>>> "$ $ echo hello world".lstrip("$ ")
'echo hello world'

@theslimshaney
Copy link
Contributor Author

This would also remove any leading spaces, like $<space><space>foo I don't think it's a problem but maybe it is.

@scorphus scorphus added this to the 3.31 milestone May 10, 2020
Copy link
Collaborator

@scorphus scorphus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Can you please include some tests for that?

Thanks for contributing!

@theslimshaney
Copy link
Contributor Author

Added some tests, let me know what you think. and also updated .gitignore to exclude venv, and requirements.txt which was missing some packages

@theslimshaney
Copy link
Contributor Author

@scorphus ping

Copy link
Collaborator

@scorphus scorphus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @theslimshaney! Please mind my comments below.

requirements.txt Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
thefuck/rules/remove_shell_prompt_literal.py Outdated Show resolved Hide resolved
@scorphus
Copy link
Collaborator

Merged in 9201ce7. Thanks, @theslimshaney.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants