![](/img/trans.png)
[英]RXCPP: Make an extension that doesn't care about the input type of the observable
[英]Why cpplint doesn't care about indentation/spaces and what is the alternative?
這是我的 C++ 代碼:
int f() {
return 1 + 2;
}
我正在嘗試通過cpplint運行它:
$ cpplint src/f.cpp
Done processing src/f.cpp
未發現錯誤。 我究竟做錯了什么? Cpplint 真的認為這段代碼的格式正確嗎? 如果真的是這樣,哪個樣式檢查器可以幫助我在這段 C++ 代碼中發現錯誤?
Cpplint 只檢查一些特殊的縮進情況,它不是一個完整的樣式檢查器。 造成這種情況的原因是 cpplint 不解析文件的屬性,而是使用正則表達式逐行檢查文件。 這使得為需要推理多行上下文的問題編寫某些檢查變得困難。
因此 cpplint 不會檢查您的示例的樣式缺陷。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.