You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2023/11/10 22:45:22 UTC
[PR] Run cmake-format on .cmake files [trafficserver]
bneradt opened a new pull request, #10764:
URL: https://github.com/apache/trafficserver/pull/10764
I updated our format scripts earlier to run cmake-format on
CMakeLists.txt files, but forgot to add in our .cmake files. This
fixes that oversight.
---
# For the Reviewer
Note that I've separated this PR into two commits:
1. The script updates to run cmake-format.
2. The formatting changes from these updates.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Run cmake-format on .cmake files [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on PR #10764:
URL: https://github.com/apache/trafficserver/pull/10764#issuecomment-1806572665
> We should format `.cmake.in` files as well. Right now this is only the configuration file for definitions, but we will probably have one for a CMake config export as well at some point.
Interestingly, the cmake-format script chokes on `.cmake.in` files (or, at least it chokes on the one that we have):
```
╰─➤ cmake-format -i include/tscore/ink_config.h.cmake.in
WARNING __main__.py:530: While processing include/tscore/ink_config.h.cmake.in
ERROR __main__.py:638: Unexpected UNQUOTED_LITERAL token at 1:0
Traceback (most recent call last):
File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 633, in main
return inner_main()
^^^^^^^^^^^^
File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 616, in inner_main
onefile_main(infile_path, args, argparse_dict)
File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 526, in onefile_main
outtext, reflow_valid = process_file(cfg, intext, args.dump)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 158, in process_file
parse_tree = parse.parse(tokens, ctx)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/parse/__init__.py", line 68, in parse
return BodyNode.consume(ctx, tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/parse/body_nodes.py", line 75, in consume
raise InternalError(
cmakelang.common.InternalError
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Run cmake-format on .cmake files [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on PR #10764:
URL: https://github.com/apache/trafficserver/pull/10764#issuecomment-1806932694
[approve ci]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Run cmake-format on .cmake files [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #10764:
URL: https://github.com/apache/trafficserver/pull/10764#issuecomment-1806586879
> > We should format `.cmake.in` files as well. Right now this is only the configuration file for definitions, but we will probably have one for a CMake config export as well at some point.
>
> Interestingly, the cmake-format script chokes on `.cmake.in` files (or, at least it chokes on the one that we have):
>
> ```
> ╰─➤ cmake-format -i include/tscore/ink_config.h.cmake.in
> WARNING __main__.py:530: While processing include/tscore/ink_config.h.cmake.in
> ERROR __main__.py:638: Unexpected UNQUOTED_LITERAL token at 1:0
> Traceback (most recent call last):
> File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 633, in main
> return inner_main()
> ^^^^^^^^^^^^
> File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 616, in inner_main
> onefile_main(infile_path, args, argparse_dict)
> File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 526, in onefile_main
> outtext, reflow_valid = process_file(cfg, intext, args.dump)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/format/__main__.py", line 158, in process_file
> parse_tree = parse.parse(tokens, ctx)
> ^^^^^^^^^^^^^^^^^^^^^^^^
> File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/parse/__init__.py", line 68, in parse
> return BodyNode.consume(ctx, tokens)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/home/bneradt/src/ts_asf_master_format_dot_cmake_files/.git/fmt/cmake_format_v0.6.13_venv/lib/python3.11/site-packages/cmakelang/parse/body_nodes.py", line 75, in consume
> raise InternalError(
> cmakelang.common.InternalError
> ```
Looks like they did not intend for `cmake-format` to work on CMake's various `.cmake.in` DSLs. Let's leave that alone for now, then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Run cmake-format on .cmake files [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt merged PR #10764:
URL: https://github.com/apache/trafficserver/pull/10764
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org