summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-18 18:59:03 +0000
committerw0rp <devw0rp@gmail.com>2017-11-18 18:59:03 +0000
commit2b50e68c7e2fb5df831f83ba89a7bd088629e1aa (patch)
treed839447229379c55490a4622bd6713fb316c2307 /README.md
parent7455e2e97d0244c420c344ee1c737c93379bca4f (diff)
downloadale-2b50e68c7e2fb5df831f83ba89a7bd088629e1aa.zip
Add an FAQ entry explaining how to configure C or C++ projects
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index 25fb72b0..481e95a9 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ servers with similar enough protocols, like `tsserver`.
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
12. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
13. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
+ 14. [How can I configure my C or C++ project?](#faq-c-configuration)
<a name="supported-languages"></a>
@@ -614,3 +615,28 @@ still be an advantage.
If you are still concerned, you can turn the automatic linting off altogether,
including the option `g:ale_lint_on_enter`, and you can run ALE manually with
`:ALELint`.
+
+<a name="faq-c-configuration"></a>
+
+### 5.xiv. How can I configure my C or C++ project?
+
+The structure of C and C++ projects varies wildly from project to project, with
+many different build tools being used for building them, and many different
+formats for project configuration files. ALE can run compilers easily, but
+ALE cannot easily detect which compiler flags to use.
+
+Some tools and build configurations can generate
+[compile_commands.json](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
+files. The `cppcheck`, `clangcheck` and `clangtidy` linters can read these
+files for automatically determining the appropriate compiler flags to use.
+
+For linting with compilers like `gcc` and `clang`, and with other tools, you
+will need to tell ALE which compiler flags to use yourself. You can use
+different options for different projects with the `g:ale_pattern_options`
+setting. Consult the documentation for that setting for more information.
+`b:ale_linters` can be used to select which tools you want to run, say if you
+want to use only `gcc` for one project, and only `clang` for another.
+
+You may also configure buffer-local settings for linters with project-specific
+vimrc files. [local_vimrc](https://github.com/LucHermitte/local_vimrc) can be
+used for executing local vimrc files which can be shared in your project.