Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-format options #11

Open
friendlyanon opened this issue Jun 4, 2021 · 2 comments
Open

clang-format options #11

friendlyanon opened this issue Jun 4, 2021 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@friendlyanon
Copy link
Owner

f325e68 introduced clang-format to the project, but instead of using one of the built-in styles, I rolled my own.

The goal of a format ruleset should be:

  • consistency
  • readability
  • diff friendliness
  • similarity to other languages (polyglot friendliness)

I hope what I created achieves that and if not, then feedback is welcome.

@friendlyanon friendlyanon added enhancement New feature or request question Further information is requested labels Jun 4, 2021
@ClausKlein
Copy link

But you should not format all files you be able to see:

/usr/local/bin/cmake -D FORMAT_COMMAND=clang-format -D "PATTERNS=*.json;*.cppm" -P /Users/clausklein/Workspace/cpp/fmt-module/cmake/lint.cmake
The following files are badly formatted:

.CMakeUserPresets.json
CMakePresets.json
CMakeUserPresets.json
build/compile_commands.json
build/dev/_CPack_Packages/Darwin/TGZ/fmt-11.0.2-Darwin/lib/cmake/fmt/module/fmt.cppm
build/dev/compile_commands.json
build/dev/src/tests/CMakeFiles/header-only-test.dir/CXXDependInfo.json
build/dev/src/tests/CMakeFiles/header-only-test.dir/CXXModules.json
build/dev/src/tests/find-package-test/CMakeFiles/fmt_module.dir/CXXDependInfo.json
build/dev/src/tests/find-package-test/CMakeFiles/fmt_module.dir/CXXModules.json
build/dev/src/tests/find-package-test/compile_commands.json
build/src/tests/CMakeFiles/header-only-test.dir/CXXDependInfo.json
build/src/tests/CMakeFiles/header-only-test.dir/CXXModules.json
build/tests/CMakeFiles/header-only-test.dir/CXXDependInfo.json
build/tests/CMakeFiles/header-only-test.dir/CXXModules.json
build/tests/compile_commands.json
module/fmt.cppm
stagedir/lib/cmake/fmt/module/fmt.cppm

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


ninja: build stopped: subcommand failed.

git ls-files '::*.json' '::*.cppm' would be better to get the file list.

@ClausKlein
Copy link

bash-5.2$ git ls-files '::*.json' '::*.cppm' '::*.cc' '::*.hh'
.CMakeUserPresets.json
CMakePresets.json
module/fmt.cppm
src/tests/header-only-test.cc
bash-5.2$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants