question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Files being changed even when all rules are met and no changes are made

See original GitHub issue

Steps to reproduce

Editor config:

root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

Versions: EditorConfig extension: 0.3.4 VSCode: 1.8.1

Steps:

  • Open a file
  • Being asked to save

Expected Behavior

Should not be asked to save.

Actual Behavior

The file is being asked to save.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jednanocommented, Dec 27, 2016

@kowsheek some Windows Git distributions (e.g., GitHub for Windows) configure your system to automatically convert line endings from LF to CRLF when files are checked out. This line-ending conversion is controlled by a Git configuration flag: autocrlf.

There is some controversy regarding the best value for autocrlf; however, having CRLF line endings will cause issues like the one you’ve just experienced. As such, I recommend configuring your repositories such that they never convert line endings.

To disable automatic line-ending conversion, you should visit each of your repositories and execute the following commands:

git config core.autocrlf false
git rm --cached -r .
git reset --hard

The first command tells Git to never change line endings (in the future). Next, we refresh each repository by removing every file from Git’s index and, finally, rewriting the Git index to pick up all the new line endings. This fixes the CRLFs that were introduced to your local file system when you cloned each repository.

Now, you can work in LF mode via EditorConfig and never introduce rogue CRLFs into your files.

You can also run git config core.autocrlf false --system to change the system-wide setting, which is actually what I do on Windows so I don’t have to deal with this on a regular basis.

1reaction
kowsheekcommented, Dec 28, 2016

I didn’t need to remove .gitattributes which I use in my repo to specify binaries such as favicons. I did the global and local setting changes to get it rolling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Check out, check in, or discard changes to files in a ...
By discarding the checkout, you can avoid making new versions when you haven't made any changes to the file. Go to the library...
Read more >
Rule 5. Serving and Filing Pleadings and Other Papers
Any paper after the complaint that is required to be served—must be filed no ... Changes Made After Publication and Comments Rule 5(b)(2)(D)...
Read more >
National Industrial Security Program Operating Manual
This rule provides that a contractor must implement changes no later than 6 months from the date of a published change to this...
Read more >
faq-providers-no-surprises-rules-april-2022.pdf - CMS
I want more information on provider and facility requirements. Are there any exceptions? Requirement: No balance billing for out-of-network ...
Read more >
Driver Services - TN.gov
The law does not require the address to be changed on your actual license, ... Mail-In Change-of-address forms are also available at any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found