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

Normalize eccentric enum values #202

Open
lassik opened this issue Oct 11, 2018 · 2 comments
Open

Normalize eccentric enum values #202

lassik opened this issue Oct 11, 2018 · 2 comments

Comments

@lassik
Copy link
Contributor

lassik commented Oct 11, 2018

All enum values in options.ts seem to be spelled using lowercase-with-dashes.

Except for 2 enums:

  • end_of_line values ["CRLF", "LF", "System Default"]
  • indent_char values [" ", "\t"]

I would change them to be like the others, and more obvious, as follows:

  • end_of_line values ["windows", "unix", "native"]
  • indent_char values ["space", "tab"]

Also, I would maybe drop the native newline setting. In a multi-OS dev team, that would cause the files to be converted back and forth between Unix and Windows newlines. (Unless Git is set to do its own newline conversion back and forth, but that brings us to another issue: there's a subtle interaction between Git's and Unibeautify's newline conversion mode, which a native choice would complicate even further.) IMHO, the ideal is for the beautifier to force a particular newline encoding on all platforms. All serious programmer's text editors can handle any newline encoding on any platform.

@Glavin001
Copy link
Member

Also, I would maybe drop the native newline setting. In a multi-OS dev team, that would cause the files to be converted back and forth between Unix and Windows newlines.

💯% agree and I was thinking about that a few months ago.


indent_char should be deprecated: https://github.com/Unibeautify/unibeautify/blob/master/src/options.ts#L122
Replaced by indent_style: https://github.com/Unibeautify/unibeautify/blob/master/src/options.ts#L163

@lassik
Copy link
Contributor Author

lassik commented Oct 23, 2018

Cool, I didn't notice the data model supports deprecated definitions :) indent_style seems prefect, and identical to .editorconfig too.

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