tree-sitter / tree-sitter-c

C grammar for tree-sitter
MIT License
225 stars 100 forks source link

bug: LF EOL settings in .gitattributes affecting test/corpus/crlf.txt #200

Closed ribru17 closed 5 months ago

ribru17 commented 5 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.21.0 (1c55abb5308fe3891da545662e5df7ba28ade275)

Describe the bug

The eol=lf setting in .gitattributes causes the CRLF endings in test/corpus/crlf.txt to be overridden.

Steps To Reproduce/Bad Parse Tree

NA

Expected Behavior/Parse Tree

NA

Repro

NA
Thaodan commented 5 months ago

Commit at fault is: https://github.com/tree-sitter/tree-sitter-c/commit/db11e9188940f2b99128635d53876ac040c8f8c3

amaanq commented 5 months ago

@ObserverOfTime

ObserverOfTime commented 5 months ago

Set eol=crlf on any files that require it.

Thaodan commented 5 months ago

Don't set gittattributes to enforce file stypes, doing so is sort of a hack since you edit files outside of git comment operations.

Please don't commit built artifacts to repositories..

Thaodan commented 5 months ago

Also checking out the last release fails because of the gittattribute being present.