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.

Clang Tidy issue - "readability-isolate-declaration" does not honor exiting EOL type CR+LF

See original GitHub issue

I am running Clang Tidy version 15.0.7 on a Windows 10 PC, via the latest versions of Clang Power Tools, LLVM 15.0.7, and Visual Studio 2022.

My C++ source files contain CR+LF end-of-line characters. But when I run Clang Tidy with the fix option for readability-isolate-declaration, the new lines are added with LF for the line ending (no CR before the LF, as I would have expected). This is causing Visual Studio to prompt me to make the EOLs consistent for each modified source file that I reopen. The mixed EOLs are also interfering with Subversion commits (yes, I am ancient: I have a land line, too).

I assume this is an issue with Clang Power Tools, rather than Clang Tidy itself. If someone can tell me how to locate and run clang-tidy.exe directly I can confirm that.

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mike4Onlinecommented, Mar 26, 2023

Looks like the line feed issue is a Clang-Tidy bug. I’ll have to take it up with the LLVM team.

Older versions of Clang-Format support end-of-line normalization – they just used a different set of settings to do it.

LLVM 16 (along with Clang 16, Clang-Tidy 16 and Clang-Format 16) was released recently.

1reaction
mariru27commented, Feb 9, 2023

Hi @Mike4Online,

You can test it by running clang-tidy.exe

Just run tidy from our extension with verbose mode on, in output you well see the command For example: VERBOSE: INVOKE: C:\Users\Marina\AppData\Roaming\ClangPowerTools\LLVM_Lite\Bin\clang-tidy.exe "C:\Users\Marina\Desktop\Repo\rsa\RSA-BigInt\BigInt\Source.cpp" -header-filter=".*" -quiet -- -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\atlmfc\include" -isystem"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\VS\include" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\winrt" -isystem"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\cppwinrt"

Get your command and run it in powershell

Kind regards, Marina

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why clang-tidy readability-isolate-declaration not fixing ...
1 Answer. There are several problems here: readability-isolate-declaration check didn't exist in clang-tidy 6. Upgrade to a more recent version.
Read more >
clang-format normalized line endings - c++
Here's an example .gitattributes file. Declare files that will always have CRLF line endings on checkout: *.sln text eol=crlf. Further ...
Read more >
Clang-Tidy — Extra Clang Tools 18.0.0git documentation
Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that ......
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