8

Full error looks like this:

"The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in force-app/....."

I know I can turn it off, and I am sure I can change the behaviour, but what is the correct behaviour.

Is this error ok before a salesforce deployment?

1
  • 1
    The question is quite clearly: Is this error ok before a salesforce deployment? People in the salesforce community might be searching for this. May 21, 2020 at 13:05

1 Answer 1

10

This isn't an error, simply a warning that the files that will be committed are different than the files you saved. The default behavior for git on windows is to convert LF to CRLF, because some editors in Windows don't know how to handle LF (e.g. Notepad would ignore them and display everything as one line of text). The choice of line ending is a project preference. The most important part is that the line endings should all be consistent within the project, as a matter of not inconveniencing the developers working on it.

Salesforce accepts any style of line ending, CR, LF, or CRLF, so you may choose whichever line ending style fits your development tools. It is perfectly okay to get this warning before a Salesforce deployment. Your deployment will not fail, nor will you be penalized for using CRLF instead of LF (e.g. your Apex Code Character Count still counts each line ending as only one character).

2
  • Classic, Forgot I even asked this question. Searching for the same answer and voila there it is you answered it right at the early stages of Cov...2020. Again you are a champion. Keep smashing it man, I hope things are good for you! Cheers Feb 2, 2021 at 4:52
  • @NZDev Thanks! You'd be surprised how often I stumble across my own answers when I search SF-related stuff, even though I know I have ~9% of all answers on SFSE, not to mention the mass number I have on developerforce.com, too. I suppose we all have memory limits 😅.
    – sfdcfox
    Feb 2, 2021 at 5:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .