TabularEditor / BestPracticeRules

An official collection of standard Rules for use with Tabular Editor's Best Practice Analyzer.
119 stars 53 forks source link

Best Practice Rules

This repository holds a recommended set of rules for the Best Practice Analyzer of Tabular Editor .

To use these rules, simply download the BPARules.json file from the releases page. Store the file in one of the following locations:

...and restart Tabular Editor. You should then see the rules show up in Best Practice Analyzer:

image

Contributing

The community is encouraged to contribute rules to the collection of Best Practices published here. You can contribute in various ways:

Conventions

Rules should be submitted in their JSON representation:

{
  "ID": string,
  "Name": string,
  "Category": string,
  "Description": string,
  "Severity": int,
  "Scope": string,
  "Expression": string,
  "FixExpression": string (optional),
  "Remarks": string (optional)
}

Rule ID must be META_ALL_UPPERCASE_WITH_UNDERSCORES, and include the category prefix (see below). Rule Name should be proper case and kept as short as possible, while still describing the essential function of the rule. Rule Description should contain a detailed developer-oriented description of the rule and suggestions on how to fix objects that are catched by the rule. Rule Severity should be an integer between 1 and 5:

  1. Not important / cosmetic only
  2. Minor importance / may cause end-user confusion or a less-than-optimal user experience
  3. Important / may cause functional issues, performance degradation or end-user confusion
  4. Very important / similar to 3, but with a higher risk of causing issues
  5. Critical / similar to 4, but guaranteed to cause issues such as deployment/processing errors or logical errors

You may add Remarks to the rule to provide comments to the community regarding the behaviour and reasoning behind the rule, and also any limitations or exceptions.

Use one of the following values for the Category of the rule:

More categories may be added over time.

Expression is the Dynamic LINQ query that will identify objects in violation of the rule. FixExpression is an optional expression of the form PropertyName = Value which will be applied to all objects in violation of the rule, if the developer lets the Best Practice Analyzer "fix" the rule.