cmake_format icon indicating copy to clipboard operation
cmake_format copied to clipboard

[cmake-lint] Incorrect "[C0327] Wrong line ending (unix)" on Windows

Open garethsb opened this issue 4 years ago • 1 comments

Testing cmake-lint with v0.6.13 on Windows with files that have \r\n at the end of all lines.

With line_ending = 'windows' in my config, I get [C0327] Wrong line ending (unix) on the last line of the file. With line_ending = 'unix' in my config, I get [C0327] Wrong line ending (windows) on every line (as expected) apart from the last line. It's like it's losing the last character of the file.

I tried line_ending = 'auto' but that doesn't seem to work for cmake-lint? I get:

ERROR An internal error occured. Please consider filing a bug report at github.com/cheshirekow/cmakelang/issues
Traceback (most recent call last):
  File "C:\Users\garethsb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cmakelang\lint\__main__.py", line 185, in main
    return inner_main()
  File "C:\Users\garethsb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cmakelang\lint\__main__.py", line 168, in inner_main
    process_file(cfg, local_ctx, intext)
  File "C:\Users\garethsb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\cmakelang\lint\__main__.py", line 35, in process_file
    config.set_line_ending(detected)
AttributeError: 'Configuration' object has no attribute 'set_line_ending'

garethsb avatar Aug 05 '21 10:08 garethsb

I am hitting this, too.

ptc-tgamper avatar Nov 22 '23 09:11 ptc-tgamper