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

Saving syntaxtest files forces unnecessary user setting #308

Closed
FrancescoManfredi opened this issue Oct 17, 2020 · 3 comments
Closed

Saving syntaxtest files forces unnecessary user setting #308

FrancescoManfredi opened this issue Oct 17, 2020 · 3 comments
Milestone

Comments

@FrancescoManfredi
Copy link

Hello guys,
I just wanted to warn you about something that looks like a problem to me: if you have the 'translate_tabs_to_spaces' setting set to false you cannot save a syntax test file even if it does not contain any tabs.
This is due to syntaxtest_dev.py:435.
The test to issue an error message should be based on the presence of tabs in the file rather than on my personal settings.
To add to why that tast should be changed, the 'translate_tabs_to_spaces' does not forces me to use tabs, so it is irrelevant to guess the presence of tabs in the syntaxtest file.

I'm sorry for not submitting a merge request with a solution, but I do not know how the sublime text api works and I think it's better if you consider how to manage this yourselves.
I hope this was useful and thanks for your effort on this project.

@FichteFoll
Copy link
Member

I suppose we could handle that better. I'll think of something more applicable when working on PD next, hopefully in the upcoming week.

@FichteFoll FichteFoll added this to the 3.3.0 milestone Oct 18, 2020
@FrancescoManfredi
Copy link
Author

FrancescoManfredi commented Oct 18, 2020 via email

@FichteFoll
Copy link
Member

All right, I thought about this again. If we were to ignore the setting entirely, users would be much more prone to accidentally inserting tab characters, which will usually break tests. Instead of just complaining about the setting, I decided to offer changing it to True.

While I could check whether a file contains tab characters, I wouldn't know what to do in that case. changing tab_size to 1 would be the known workaround to ensure that assertion lines still visually line up with the lines they are testing against. However, this is such a special case that I don't want to delve into it until we find an actual use case for this, i.e. a syntax where you must use tabs.

Does this suffice for you?

FichteFoll added a commit that referenced this issue Jan 18, 2021
Instead of just being obnoxious, we offer to change the setting to
prevent users from making mistakes by accidentally introducing tab
characters.

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

No branches or pull requests

2 participants