formatting - 如果其格式不符合某些规则,如何使您的代码不可编译?

标签 formatting compiler-errors

如果其格式不符合某些规则,如何使代码不可编译?
例如(C#语言):

if (a < b)
{
                  // <-- build error with message "empty line"
     k = j + h;
}

要么
public void Method(int a, int name) // <-- build error with message "parameter name 'a' is too short"
{
    //...
}

最佳答案

如果您专门针对C#样式检查,是否尝试过stylecop

有关样式检查器的完整列表,wikipedia是您的 friend 。

关于formatting - 如果其格式不符合某些规则,如何使您的代码不可编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10961159/

相关文章:

带有长 if 谓词的 Python 风格

python - 如何在没有任何额外符号(方括号 [] 和元素之间的空格)的情况下打印 Numpy 数组?

Excel在单元格中显示无限重复的值

Scala 2.10 类型推断因 ADT 失败 - 从 2.9.3 回归

c++ - 通过const引用传递constexpr时在编译过程中占用大量内存

eclipse - Eclipse 中的多行字符串对齐/缩进

c# - 以编程方式使用缩进格式化 C# 代码

C错误: assignment to expression with array type

c++ - 使用 C++ 模板时的编译错误

javascript - iOS 5 - 编译用于调试的私有(private) API - 特别是 _enableRemoteInspector