Now, trying to check the above code, the cmake-format crashes with the following traceback:
WARNING __main__.py:530: While processing ./test.cmake
Traceback (most recent call last):
File "/usr/bin/cmake-format", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3.10/site-packages/cmakelang/format/__main__.py", line 633, in main
return inner_main()
File "/usr/lib/python3.10/site-packages/cmakelang/format/__main__.py", line 616, in inner_main
onefile_main(infile_path, args, argparse_dict)
File "/usr/lib/python3.10/site-packages/cmakelang/format/__main__.py", line 526, in onefile_main
outtext, reflow_valid = process_file(cfg, intext, args.dump)
File "/usr/lib/python3.10/site-packages/cmakelang/format/__main__.py", line 166, in process_file
box_tree = formatter.layout_tree(parse_tree, config, first_token=first_token)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 1778, in layout_tree
root_box.reflow(stack_context, Cursor(0, 0))
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 1594, in _reflow
cursor = child.reflow(stack_context, column_cursor, passno)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 1620, in _reflow
cursor = child.reflow(stack_context, column_cursor, passno)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 806, in reflow
return super(StatementNode, self).reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 892, in _reflow
cursor = child.reflow(stack_context, cursor, passno)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 1420, in _reflow
cursor = child.reflow(stack_context, cursor, passno)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 1274, in _reflow
cursor = child.reflow(stack_context, input_cursor, passno)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 688, in _reflow
cursor = child.reflow(stack_context, cursor + (0, 1), passno)
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 560, in reflow
outcursor = self._reflow(
File "/usr/lib/python3.10/site-packages/cmakelang/format/formatter.py", line 1699, in _reflow
self._colextent = cursor[1] + max(len(line) for line in lines)
ValueError: max() arg is an empty sequence
cmake-format version: 0.6.13
cmake-format is run as below:
find -type f -name "*.cmake" | xargs cmake-format -i
I have a function that has bracket comments inside the declaration:
Doing a
--check
on the above code results in an error (expected):ERROR __main__.py:618: Check failed: ./test.cmake
When formatting the above block of code, the result is as below:
Now, trying to check the above code, the cmake-format crashes with the following traceback:
cmake-format version: 0.6.13
cmake-format is run as below: