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

indentation format should be configurable (or default to 4 spaces) #93

Open
paulie4 opened this issue Aug 21, 2020 · 3 comments
Open

indentation format should be configurable (or default to 4 spaces) #93

paulie4 opened this issue Aug 21, 2020 · 3 comments

Comments

@paulie4
Copy link

paulie4 commented Aug 21, 2020

If I'm reading this code correctly, it looks like a tab (\t) is hard-coded as the additional indentation format, even though PEP 8 says, "Spaces are the preferred indentation method." Can this be made configurable or maybe default to 4 spaces instead of a tab character, since this causes errors if the next line of code at the same level uses spaces instead of tabs?

@grisha
Copy link
Owner

grisha commented Aug 24, 2020

Pull requests are welcome!

@paulie4
Copy link
Author

paulie4 commented Aug 24, 2020

I'm not familiar at all with this code and just searched for what would be adding the \t indent. Do you have a suggestion for what should be done to make it configurable (although, I'm not sure if/when I'll get a chance to implement the changes)? Thanks!

@paulie4
Copy link
Author

paulie4 commented Sep 4, 2020

What we ended up doing was this workaround:

rawPsp = _psp.parse(...)
cleanPsp = re.sub(r'^(\s+)', lambda x: x.group(1).replace('\t', '    '), rawPsp, flags=re.MULTILINE)

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

No branches or pull requests

2 participants