SolomonDefi / solomon-monorepo

Monorepo containing core Solomon apps, services, libraries, and deploy config.
6 stars 4 forks source link

Hooks and generated files #176

Closed apolkingg8 closed 2 years ago

apolkingg8 commented 2 years ago

Close #175

apolkingg8 commented 2 years ago

I guess the EOL git diff issue is because we didn't have Nx format:write in git hook before, so the file EOL can be CRLF or CR. But I'm not really sure because as far as I know the EOL change would not be committed into git.

solomondefi-dev commented 2 years ago

Ok, but before merging we need to figure out the reason and fix it. It's not sustainable to rewrite entire files in a feature PR, it makes it almost impossible to review.

I don't think the Nx format command is doing this since I can't reproduce locally, if so it's an Nx windows bug. Are you sure the git commit hook for EOL is working correctly? I think it's more likely this is an editor issue.

apolkingg8 commented 2 years ago

When I run Nx format:write --all, I can see 288+ files modified and all of them are EOL changes. If a file changes only EOL, it will not be shown in git diff, but if a file changes both EOL and content, it will cause a "whole file change" issue.

apolkingg8 commented 2 years ago

Just add .gitattributes to make sure all text files in git are LF, but I'm not sure how git shows the file diff when A and A' have different EOL. It's about existing files and I never open them so I don't think it's about my editor.

solomondefi-dev commented 2 years ago

Hm, that's strange. Thanks for fixing, we can keep an eye on it in the future.

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 1.3.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: