visual-studio - 从 StyleCop 4.7 (Classic) 更新到 StyleCop.Analyzers

标签 visual-studio code-organization stylecop

我正在我的 VS2015 中将 stylecop classic 升级到最新版本 (StyleCop.Analyzers 1.0.0),根据 GitHub 的介绍,我不能再使用 Settings.StyleCop,只能创建一个新的 stylecop.json 文件。

现在的问题是我在 settings.StyleCop 中确实有一些自定义设置,例如拼写选项卡中的“可识别的单词”,以及选项选项卡中的某些选项。如何将它们添加到 json 文件中?在他们的 github 网站上找不到任何关于此的内容。请帮忙。

最佳答案

所有配置选项都记录在此处:Configuration.md

分析器项目删除了拼写检查以提高性能 (see Issue 1057)

Several documentation rules are subjective and aim to establish the quality of documentation content. These rules take CPU time to evaluate and are an overall poor indicator of documentation quality. I believe with the rules in place, developers will be focused on the wrong aspects of documentation during the development process.

SA1628: Documentation text must begin with a capital letter
SA1630: Documentation text must contain whitespace
SA1631: Documentation must meet character percentage
SA1632: Documentation text must meet minimum character length
SA1650: Element documentation must be spelled correctly

I propose that each of these rules be permanently disabled in StyleCopAnalyzers.

关于拼写检查,

您可以考虑使用代码分析 + Code Analysis Dictionary . (例如:CA1704: Identifiers should be spelled correctly)

另一种选择是使用以拼写为中心的 visual studio 插件(参见 Visual Studio Spell Checker Extension)

关于visual-studio - 从 StyleCop 4.7 (Classic) 更新到 StyleCop.Analyzers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35164385/

相关文章:

git - 让 GIT 忽略/删除 DLL、PDB 和类似生成的文件

wpf - 使用 Visual Studio 指定应用程序的图标

php - 在哪里放置实体的额外辅助函数

c++ - 扩展现有类,如命名空间 (C++)?

c# - 如何抑制整个命名空间文件的 StyleCop 警告

c++ - 如何减少 visual studio 非托管代码中的发布构建时间?

angular - UI 和 API 的两个独立解决方案

c - 您应该将 "typedef enum"放在源代码的什么位置?

tfs - 如何将 StyleCop 集成到 Tfs 2010 中

c# - 如何抑制 stylecop 错误 SA1650(拼写错误的单词)