I order to use clang tools like clang-format, clang-tidy or generate a compilation database like this, I need to know the WORKSPACE directory withi
clang-format
clang-tidy
If you're like me and writing a repository_rule instead of a regular one, resolving the following label can help you: "@//:WORKSPACE"
repository_rule
"@//:WORKSPACE"
Then use ctx.path to extract the required data: https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#path
ctx.path