Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@murfalo
Copy link

@murfalo murfalo commented Oct 3, 2019

Really quick fix for the issue I created just a minute ago (#2806)

@murfalo murfalo changed the title Added automatic compile-commands-dir arg to ale_cpp_clangd linter (#2806) Added automatic compile-commands-dir arg to ale_cpp_clangd linter Oct 3, 2019
Copy link
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. Can you add a test for this? Search for tests that mention compile_commands.json in them, and you can create empty files similar to how they do.

@w0rp w0rp added the fix tests label Oct 9, 2019
@murfalo
Copy link
Author

murfalo commented Oct 9, 2019

I updated the ale-c-clangd linter to match the ale-cpp-clangd linter and added a test case for automatic detection of compile commands. My last commit a1fab59 has a fix for certain variables leaking out of the test and causing mayhem. I'm sure this fix is not perfect, but I'm unfortunately a total noob when it comes to VimScript so I'm not immediately sure how to do it better.

EDIT: Two things I wanted to note:

  1. It appears that a few of the c/cpp linters only have tests for c. Maybe we should add a new issue to add tests for cpp? Would mostly be copy & paste (since the linters themselves are practically identical), which may explain why they aren't duplicated.
  2. Both the clang-tidy linter and the clangd linter allow the user to specify miscellaneous additional flags. If the user specifies the build directory AND the linter automatically detects a build directory, clangd/clang-tidy will fail to run, stating that the associated build dir flag can only be specified zero or one times. Should this be considered user error, or should we handle this condition somehow?
  3. The ale_c_parse_compile_commands variable doesn't appear to do anything. Am I missing something, or is this a bug?

@w0rp w0rp merged commit a1fab59 into dense-analysis:master Oct 17, 2019
@w0rp
Copy link
Member

w0rp commented Oct 17, 2019

Cheers! 🍻

@murfalo murfalo deleted the clangd-compile-commands branch October 17, 2019 17:18
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.

2 participants