cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
958 stars 105 forks source link

cmake-lint crash while process CMakeLists.txt #169

Closed hellozee closed 4 years ago

hellozee commented 4 years ago

Here is the CMakeLists.txt

and the corresponding traceback

WARNING While processing CMakeLists.txt
Traceback (most recent call last):
  File "/home/hellozee/.local/bin/cmake-lint", line 11, in <module>
    sys.exit(main())
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/__main__.py", line 142, in main
    process_file(cfg, local_ctx, intext)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/__main__.py", line 43, in process_file
    basic_checker.check_parse_tree(config, local_ctx, parse_tree)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 565, in check_parse_tree
    check_tree(cfg, local_ctx, node)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 548, in check_tree
    check_body(cfg, local_ctx, node)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 358, in check_body
    check_tree(cfg, local_ctx, child)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 554, in check_tree
    check_statement(cfg, local_ctx, node)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 507, in check_statement
    check_tree(cfg, local_ctx, child)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 552, in check_tree
    check_arggroup(cfg, local_ctx, node)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 376, in check_arggroup
    check_tree(cfg, local_ctx, child)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 556, in check_tree
    check_positional_group(cfg, local_ctx, node)
  File "/home/hellozee/.local/lib/python3.6/site-packages/cmake_lint/basic_checker.py", line 381, in check_positional_group
    min_npargs = get_min_npargs(node.spec.npargs)
AttributeError: 'NoneType' object has no attribute 'npargs'

Am I doing something wrong?

cheshirekow commented 4 years ago

You're not doing anything wrong. cmake-lint is super new and doesn't have great test coverage. This is the same as #168 and I think is already fixed upstream. Please try again with the next release.

hellozee commented 4 years ago

ohh good to know, thanks for working on it, :smile:

cheshirekow commented 4 years ago

This is done. Will be in the next release.