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

[Formatting] force line-feed line endings for all text files for easier windows development #1635

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

timkpaine
Copy link
Member

@timkpaine timkpaine commented Nov 28, 2021

im doing some work on windows for conda and dont want to leak crlf into the code, we only enforce on .js files rn

@timkpaine timkpaine added the internal Internal refactoring and code quality improvement label Nov 28, 2021
@timkpaine timkpaine requested a review from texodus November 28, 2021 23:01
@timkpaine timkpaine changed the title force lf [Formatting] force line-feed line endings for all text files for easier windows development Nov 29, 2021
@timkpaine
Copy link
Member Author

@texodus this is good to go, should basically be a no-op but will be helpful when I work on perspective on windows as I won't leak CRLF into the codebase

@timkpaine
Copy link
Member Author

if you want I can do a full dos2unix on the codebase to purge any existing CRLF

@texodus
Copy link
Member

texodus commented Nov 29, 2021

@timkpaine I would prefer a lint hook that fails on CI when CRLF are present anywhere, to just a single PR that just fixes them once. Unfortunately configuring proper linting for this project is a pain - the linting/formatting story for every language Perspective uses is bad, and bad for entirely different reasons -

  • JavaScript has multiple competing standards for linting and formatting, as well as some cultural obsession with separation-of-concerns such that linting and formatting are performed by different libraries. Don't get me started on TypeScript ...
  • clang-format applies arbitrarily different rules depending on what version of clang/OS you use, meaning local dev and CI get different failures (or even just different OSes for the same PR).
  • HTML seems to be the formatter no one cares about, except ****ing VSCode which insists on changing every line in the file based on that version's arbitrary standards every time I go to update an example.
  • Speaking of VSCode, it has validators for TOML, YAML, JSON - and they all have different hard-coded indentations that the user and file settings don't override (2, 2, 4, respectively). Plus, exactly none of them correctly validate.
  • To top it off, running all of these validation/auto-formatters in sequence takes substantially longer than esbuild now.

Sorry, I know that's not what you asked ... I think I've been repressing that for a long time.

Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the PR!

@texodus texodus merged commit 5d970ee into finos:master Nov 29, 2021
@timkpaine
Copy link
Member Author

@texodus well with the .gitattributes change, any time you git add a file it should have CRLF swapped for LF, no need for it to even reach precommit. But it will only apply from now on

@timkpaine timkpaine deleted the tkp/lf branch November 29, 2021 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal refactoring and code quality improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants