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

Adjust .clang-format to match style used in readonly_graph.h #6

Open
wants to merge 1 commit into
base: SISAP
Choose a base branch
from

Conversation

Tradias
Copy link
Collaborator

@Tradias Tradias commented Aug 12, 2024

VSCode

  1. Install xaver.clang-format extension (if you already have the clangd extension then you can skip this step)
  2. Open keyboard shortcuts (press ctrl + k followed by ctrl + s)
  3. Search for Format Document, change the keybind as desired. Ctrl + alt + f seems to be a common bind, it also works on https://godbolt.org/
  4. Open any header or cpp file and press the keybind. It will ask you to configure a formatter, select xaver.clang-format. Alternatively put this into user settings.json:
    "[cpp]": {
        "editor.defaultFormatter": "xaver.clang-format"
    },
    "[c]": {
        "editor.defaultFormatter": "xaver.clang-format"
    },

Pre-commit hook

Since this is a multi language project you will probably want to set up a more sophisticated hook that formats and lints c++, python and java. https://pre-commit.com/ might be able to do that but I have not looked into it. For a pure CMake-based hook for C++ see https://github.com/Tradias/asio-grpc/blob/master/cmake/AsioGrpcInstallGitHooks.cmake for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant