prefer spaces to tabs in CMakeLists.txt #4593
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I learned today that @tkruse, the maintainer of
cpplint
, also maintains a static analyzer forCMakeLists.txt
files, calledcmakelint
!You can learn about this tool at https://github.com/cmake-lint/cmake-lint.
I ran it over
LightGBM
today, and found that it had mainly cosmetic recommendations:full log and commands I ran (click me)
Installed on my mac
then ran from root of the repo
full logs
This PR proposes fixing just one of those issues.
I don't think this is causing any problems, but fixing it might help to prevent strange parsing issues from different versions of
cmake
.Notes for Reviewers
@StrikerRUS , what do you think about running this in the
lint
task in CI? It's available from PyPI, has no additional dependencies, and runs very fast (< 1 second on my Mac).I'm not sure that it will catch any bugs that wouldn't be caught by our other tests, but it will enforce some consistency in syntax, which might reduce the maintenance effort for PRs that change CMakeLists.txt.