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

.gitattributes: set .checksrc as LF #12924

Closed
wants to merge 2 commits into from

Conversation

Karlson2k
Copy link
Contributor

@Karlson2k Karlson2k commented Feb 10, 2024

This PR fixes debug builds on Windows.

CRLF line ending in .checksrc files is not handled by scripts/checksrc.pl

@jay
Copy link
Member

jay commented Feb 18, 2024

I notice all other file reads in checksrc are handled with $windows_os ? $_ =~ s/\r?\n$// : chomp; so I propose we do that instead:

diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl
index 76f4660..be085e0 100755
--- a/scripts/checksrc.pl
+++ b/scripts/checksrc.pl
@@ -120,6 +120,7 @@ sub readlocalfile {
     open(my $rcfile, "<", "$dir/.checksrc") or return;
 
     while(<$rcfile>) {
+        $windows_os ? $_ =~ s/\r?\n$// : chomp;
         $i++;
 
         # Lines starting with '#' are considered comments

@jay jay added the script label Feb 18, 2024
@Karlson2k
Copy link
Contributor Author

Karlson2k commented Feb 18, 2024

We can use both fixes.
There is no reason to have LF->CRLF transformation in .checksrc files.

@jay
Copy link
Member

jay commented Feb 18, 2024

Thanks. I landed this but omitted the gitattributes change. IMO there's no reason to have a special exception since it can now be handled like the other input files.

@Karlson2k Karlson2k deleted the gitattributes_fix_01 branch February 18, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants