Clang Tidy issue - "readability-isolate-declaration" does not honor exiting EOL type CR+LF
See original GitHub issueI 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:
- Created 7 months ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
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.
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