dense-analysis / dense-analysis/ale
C/C++ Linting Meta Issue
- Dominant language
- Vim Script
- Stars
- 14k
- Forks
- 1.5k
- Avg merge
- 17h 49m
- Merged PRs (30d)
- 1
Description
There are always issues reported because detecting the correct flags to use for linting C and C++ files is nearly impossible to do well for all projects. The `g:ale_c_parse_compile_commands` option has now been enabled by default, so ALE can detect flags from the output of `compile_commands.json` files by default. I have [updated the FAQ](https://github.com/dense-analysis/ale#faq-c-configuration), and you should try using `compile_commands.json` files in your projects.
People also have issues now and then with parsing weird C or C++ errors, and it's hard to fix one thing without breaking another.
This issue will collect generally any issue relating to C/C++ linting, in an attemp to make C/C++ linting better as a whole, by default.
## Known Issues
- [x] `.h`/`.hpp` files don't use `compile_commands.json` files. Open PR here: #2919
- [x] `clangtidy` treats `.h` as C headers. Open PR here: #2742
- [x] `-fstack-usage` for gcc can generate weird errors. Issue raised here: #3200
- [x] `compile_commands.json` parsing filters out `@file` flags, such as those generated by bear. Open PR here: #3178
- [x] `-std` in the default options replaces the `-std` from `compile_commands.json`, which causes problems with using the wrong C++ standard. Open PR here: #3056
- [x] `compile_commands.json` paths aren't resolved relative to the `directory` for each entry. #3307
- [x] `-include` isn't parsed. #3317
- [x] `make -n` doesn't always give output. #3247 #2038
- [ ] C/C++ project detection isn't configurable. #3165
- [ ] We should parse `compile_flags.txt` if we can't parse `compile_commands.json`. #2831
## Ideas for Ease of Use
- [x] A `cc` linter to replace `gcc` and `clang` #3299
- [ ] Automatically determine the C/C++ compiler to use from build files. #3328
Contributor guide
Assessment
This issue has not been assessed yet.