xunit/xunit

Implement scoring for how "literal" an expression is

クローズ

#1,251 opened on 2017/05/07

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)C# (761 件のフォーク)batch import
AnalyzersFeaturehelp wanted

Repository metrics

Stars
 (3,873 個のスター)
PR merge metrics
 (PR metrics pending)

説明

From @marcind on September 12, 2016 20:2

Rule xUnit2000 has logic for determining whether an expression is a "literal". Change the logic to implement a scoring mechanism. Something like the following (most "literal" first)

  1. null, Literal Expressions, typeof, nameof, sizeof, default, enum values
  2. Consts and static read-only fields/properties (include reference types or not?)
  3. New "instances" of structs
  4. Certain factory methods on structs (e.g. DateTime.Parse)
  5. Everything else.

If the second arg has a lower score than the first arg, trigger the rule.

Copied from original issue: xunit/xunit.analyzers#27

コントリビューターガイド