Open JesseTatasciore opened 2 months ago
eslint fix is https://github.com/aspect-build/rules_lint/blob/main/lint/eslint.stylish-formatter.js#L1-L4
Yes, this is important since you can't click the file in your terminal to navigate to the site you want to edit. @jsharpe do you happen to know if this is easy to fix?
Not sure - a quick search shows this https://github.com/microsoft/vscode-cpptools/issues/9555 which shows it definitely is possible to get relative outputs from clang-tidy though; maybe the wrapper for clang-tidy needs to ensure that its passing sources as relative paths in its input?
Interesting, if I bypass Aspect CLI and run with vanilla Bazel, it's mostly relative paths but some absolute.
example % ./lint.sh src/cpp/...
src/cpp/main/hello-greet.h:6:13: error: function 'get_greet' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name,-warnings-as-errors]
std::string get_greet(const std::string &thing);
^
/private/var/tmp/_bazel_alexeagle/3eecd93732ac7c6f4f360a54a468da50/sandbox/darwin-sandbox/9/execroot/_main/src/cpp/main/hello-greet.cc:5:13: note: the definition seen here
std::string get_greet(const std::string& who) { return "Hello " + who; }
^
src/cpp/main/hello-greet.h:6:13: note: differing parameters are named here: ('thing'), in definition: ('who')
std::string get_greet(const std::string &thing);
^ ~~~~~
who
What happened?
When running
bazel lint //speller/...
I am seeing absolute filepaths (which include the bazel output tree) with the linting results:I expected to see relative filepaths outputed instead:
Version
Development (host) and target OS/architectures:
Reproduceable on MacOS and Ubuntu
Output of
bazel --version
:(This happens on all versions of the Aspect CLI)
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved:
Clang-Tidy
How to reproduce
Any other information?
We have solved this problem for eslint. Look into how we fixed it there and apply it to clang tidy as well