friendlyanon / cmake-init

The missing CMake project initializer
GNU General Public License v3.0
2.03k stars 78 forks source link

The version of clang-tidy should be mentioned in the README #32

Closed bensuperpc closed 2 years ago

bensuperpc commented 2 years ago

I have this error even though the file seems to be well formatted :

cmake -D FORMAT_COMMAND=clang-format-11 -P cmake/lint.cmake
  cmake -D FORMAT_COMMAND=clang-format-11 -P cmake/lint.cmake
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.8.12/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.12/x64/lib
The following files are badly formatted:

include/ThreadPool/ThreadPool.hpp

CMake Error at cmake/lint.cmake:51 (message):
  Run again with FIX=YES to fix these files.

Error: Process completed with exit code 1.

CI error: https://github.com/bensuperpc/ThreadPool/runs/4320815529?check_suite_focus=true#step:5:15

I have no errors with this command on Manjaro: cmake -D FORMAT_COMMAND=clang-format-13 -P cmake/lint.cmake

The file appears to be formatted well with clang-format-13 (no changes): clang-format-13 -style=file -i include/ThreadPool/ThreadPool.hpp

The file that causes concern: https://github.com/bensuperpc/ThreadPool/blob/master/include/ThreadPool/ThreadPool.hpp

Does having clang-format-13 change anything ?

bensuperpc commented 2 years ago

I solved the problem using clang-format-11 with docker:

https://github.com/Witekio/clang-format-checker-docker

friendlyanon commented 2 years ago

The CI environment for Ubuntu ships with Clang and associated tools at v10, v11 and v12, and v11 seemed like a nice middle ground. The version used could be mentioned in the README however, because the only way a person would know about this is if they checked the CI workflow thoroughly.

I'll reopen this so I don't forget.