[libcxx-commits] [PATCH] D116958: [libc++] Alphabetize CMakeLists.txt and module.modulemap; enforce in CI.
Alexander Richardson via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jan 12 07:21:50 PST 2022
arichardson added inline comments.
================
Comment at: libcxx/test/libcxx/lint/lint_cmakelists.sh.py:3
+
+import os
+
----------------
I just discovered https://github.com/cheshirekow/cmake_format which does things like sorting source lists. I wonder if using that in the future would make sense? I just tried running cmake-format on some of the files and it doesn't seem too bad although the defaults probably need tweaking to avoid unnecessary churn.
================
Comment at: libcxx/test/libcxx/lint/lint_cmakelists.sh.py:7-13
+ libcxx_test_libcxx_lint = os.path.dirname(os.path.abspath(__file__))
+ libcxx = os.path.abspath(os.path.join(libcxx_test_libcxx_lint, '..', '..', '..'))
+ cmakelists_name = os.path.join(libcxx, 'include', 'CMakeLists.txt')
+ assert os.path.isfile(cmakelists_name)
+
+ with open(cmakelists_name, 'r') as f:
+ lines = f.readlines()
----------------
I find python path manipulation a bit easier to read with `from pathlib import Path` and we depend on 3.5 (or 3.6?) now so it can be used.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116958/new/
https://reviews.llvm.org/D116958
More information about the libcxx-commits
mailing list