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

Split 'spacecount' into two settings #293

Closed
MoreFamed opened this issue Apr 26, 2022 · 2 comments · Fixed by #301
Closed

Split 'spacecount' into two settings #293

MoreFamed opened this issue Apr 26, 2022 · 2 comments · Fixed by #301
Labels
enhancement New feature or request
Milestone

Comments

@MoreFamed
Copy link

Now, spacecount settings sets number of space characters both for indentation and for separating (a keyword and its) arguments. However, almost all members of our team tend to indent with 4 spaces but on the other hand they separate arguments with 2 spaces. Like that:

FOR-IN-ENUMERATE
    FOR  ${index}  ${item}  IN ENUMERATE  @{LIST}
        My Keyword  ${index}  ${item}
    END

I think the reason of this is that a space character is less noticeable when surrounded with other spaces (like when used for indentation) than when it is surrounded with non-white characters (like when separating arguments). So in the first case one needs to use more spaces than in the other one to have similar perception of distance between things...

Shortly: please, could you split spacecount into two independent settings: one for indentation and the other one for separating things?

@bhirsz
Copy link
Member

bhirsz commented Apr 26, 2022

Sounds plausible and useful.

I can add indentation (or indent) and separatorcount (temporary name, I don't have good idea.. we have --separator already for type of the separator - space or tab). If there are not set it can use (old) spacecount setting value.
Optionally we can only add indentation which by default would be equal to spacecount -> so it would be possible to:

indent 4 spaces separator 2 spaces

robotidy --indentation 4 --spacecount 2 .

indent 2 spaces separator 4 spaces

robotidy --indentation 2 --spacecount 4 .

indent 4 spaces separator 4 spaces

robotidy --spacecount 4 .

@bhirsz bhirsz added the enhancement New feature or request label Apr 26, 2022
@bhirsz bhirsz added this to the 2.3.0 milestone Apr 26, 2022
@bhirsz
Copy link
Member

bhirsz commented May 22, 2022

Linked PR. Most transformers try to be non-destructive to indents/separators if possible that's why most of the work was done in NormalizeSeparators transformer. Let me know after next release if I missed something.

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

Successfully merging a pull request may close this issue.

2 participants