Rules Config Guide

Use cs rules-config to validate and update your Code Health config file.

Default file

If no file is provided, the command uses:

.codescene/code-health-rules.json

from the current git repository.

Validate

cs rules-config validate

Validate a specific file:

cs rules-config validate --config-path /path/to/code-health-rules.json

Enable or disable a rule

Single rule_set in file:

cs rules-config set-rule --rule-name "Complex Method" --enabled false

Multiple rule_set entries:

cs rules-config set-rule --matching-content-path "**/*.js" --rule-name "Complex Method" --enabled false

Set a threshold

Single rule_set in file:

cs rules-config set-threshold --threshold-name function_lines_of_code_warning --value 120

Multiple rule_set entries:

cs rules-config set-threshold --matching-content-path "**/*.js" --threshold-name function_lines_of_code_warning --value 120

Notes

  • --enabled true stores weight 1.0 and --enabled false stores weight 0.0 in the config file.

  • If multiple rule_set entries exist and you do not pass --matching-content-path, the command fails and prints available selectors.

  • Unknown rule or threshold names fail with suggestions.

  • If an update creates invalid config, the original file is restored.