# tombi: Value Directive
Value comment directives are comments that apply to a specific value.
Available Options
- format
- lint
- lint.rules
- lint.rules.type-mismatch
- lint.rules.const-value
- lint.rules.enumerate
- lint.rules.deprecated
- lint.rules.one-of-multiple-match
- lint.rules.key-empty
- lint.rules.key-not-allowed
- lint.rules.key-pattern
- lint.rules.tables-out-of-order
- lint.rules.dotted-keys-out-of-order
- lint.rules.table-max-keys
- lint.rules.table-min-keys
- lint.rules.table-key-required
- lint.rules.string-max-length
- lint.rules.string-min-length
- lint.rules.string-format
- lint.rules.string-pattern
- lint.rules.integer-maximum
- lint.rules.integer-minimum
- lint.rules.integer-exclusive-maximum
- lint.rules.integer-exclusive-minimum
- lint.rules.integer-multiple-of
- lint.rules.array-max-values
- lint.rules.array-min-values
- lint.rules.array-unique-values
- lint.rules
Format Rules
Value directives can be used to control automatic sorting behavior. This is especially useful as a temporary workaround when the JSON Schema provided by Schema Store contains errors, or when you want to customize sorting for configuration files that do not have an associated JSON Schema. By specifying sorting rules directly in comments, you can enable or disable automatic sorting according to your needs.
The option corresponding to x-tombi-table-keys-order-by is not supported by comment directives.
format.rules.table-keys-order
Controls the sorting method of table keys.
- Type:
String ^ { disabled = true } - Values:
"ascending"- Sort in ascending order"descending"- Sort in descending order"version-sort"- Sort by version based on the Rust style guide{ disabled = true }- Disable sorting
# Disable sorting
# tombi: format.rules.table-keys-order.disabled = true
[project]
name = "tombi"
readme = "README.md"
version = "0.1.0"
# Enable ascending sort
# tombi: format.rules.table-keys-order = "ascending"
[tool.uv]
cache-dir = "~/.cache/uv"
offline = trueformat.rules.array-values-order
Controls the sorting method of array values.
- Type:
String ^ { disabled = true } - Values:
"ascending"- Sort in ascending order"descending"- Sort in descending order"version-sort"- Sort by version based on the Rust style guide{ disabled = true }- Disable sorting
# Enable version-sort for array values
# tombi: format.rules.array-values-order = "version-sort"
dependencies = ["1.1.0", "1.10.0", "1.2.0"]Lint Rules
Value comment directives allow you to disable specific lint rules for individual values.
This disable setting is a temporary workaround for incorrect JSON Schema.
Please consider contacting the JSON Schema provider (e.g., Schema Store) to fix the JSON Schema.
lint.rules.type-mismatch
Check if the value is of the correct type.
lint.rules.type-mismatch.disabled
Disable type-mismatch rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.type-mismatch.disabled = true
version = 123 # Normally expects stringlint.rules.const-value
Check if the value is equal to the const value.
lint.rules.const-value.disabled
Disable const-value rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.const-value.disabled = true
type = "wrong-value" # Schema expects specific const valuelint.rules.enumerate
Check if the value is one of the values in the enumerate.
lint.rules.enumerate.disabled
Disable enumerate rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.enumerate.disabled = true
license = "Unknown" # Not in enum listlint.rules.deprecated
Check if the value is deprecated (Warning level).
lint.rules.deprecated.disabled
Disable deprecated rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.deprecated.disabled = true
old-field = "value" # Deprecated fieldlint.rules.one-of-multiple-match
Check if more than one schema in the oneOf is valid.
lint.rules.one-of-multiple-match.disabled
Disable one-of-multiple-match rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.one-of-multiple-match.disabled = true
ambiguous-field = "value"lint.rules.key-empty
Check if the key is empty (Warning level).
lint.rules.key-empty.disabled
Disable key-empty rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.key-empty.disabled = true
"" = "value" # Empty key is valid but discouragedlint.rules.key-not-allowed
Check if the key is not defined in this table.
lint.rules.key-not-allowed.disabled
Disable key-not-allowed rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.key-not-allowed.disabled = true
[project]
undefined-key = "value" # Not defined in schemalint.rules.key-pattern
Check if the key matches the pattern in the schema.
lint.rules.key-pattern.disabled
Disable key-pattern rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.key-pattern.disabled = true
[tool.mytools]
Invalid-Key = "value" # Key doesn't match patternlint.rules.tables-out-of-order
Check if tables are defined out of order (Warning level).
If tombi: format.rules.table-keys-order.disabled = true is set, warnings for this rule are automatically disabled.
lint.rules.tables-out-of-order.disabled
Disable tables-out-of-order rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.tables-out-of-order.disabled = true
# VALID BUT DISCOURAGED
[fruit.apple]
[animal]
[fruit.orange]
# RECOMMENDED
[fruit.apple]
[fruit.orange]
[animal]lint.rules.dotted-keys-out-of-order
Check if dotted keys are defined out of order (Warning level).
If tombi: format.rules.table-keys-order.disabled = true is set, warnings for this rule are automatically disabled.
lint.rules.dotted-keys-out-of-order.disabled
Disable dotted-keys-out-of-order rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.dotted-keys-out-of-order.disabled = true
# VALID BUT DISCOURAGED
apple.type = "fruit"
orange.type = "fruit"
apple.skin = "thin" # Out of order
orange.skin = "thick"lint.rules.table-max-keys
Check if the table has more than the maximum number of keys.
lint.rules.table-max-keys.disabled
Disable table-max-keys rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.table-max-keys.disabled = true
[config]
key1 = "value1"
key2 = "value2"
key3 = "value3" # Exceeds maxProperties in schemalint.rules.table-min-keys
Check if the table has less than the minimum number of keys.
lint.rules.table-min-keys.disabled
Disable table-min-keys rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.table-min-keys.disabled = true
[config]
# Missing required minimum keyslint.rules.table-key-required
Check if the required key exists in this table.
lint.rules.table-key-required.disabled
Disable table-key-required rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.table-key-required.disabled = true
[project]
# Missing required 'name' fieldlint.rules.string-max-length
Check if the string is longer than the max length.
lint.rules.string-max-length.disabled
Disable string-max-length rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.string-max-length.disabled = true
description = "Very long description that exceeds maxLength..."lint.rules.string-min-length
Check if the string is shorter than the min length.
lint.rules.string-min-length.disabled
Disable string-min-length rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.string-min-length.disabled = true
name = "x" # Too shortlint.rules.string-format
Check if the string matches the format.
lint.rules.string-format.disabled
Disable string-format rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.string-format.disabled = true
email = "invalid-email" # Doesn't match email formatlint.rules.string-pattern
Check if the string matches the pattern.
lint.rules.string-pattern.disabled
Disable string-pattern rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.string-pattern.disabled = true
version = "invalid" # Doesn't match version patternlint.rules.integer-maximum
Check if the integer is less than or equal to the maximum.
lint.rules.integer-maximum.disabled
Disable integer-maximum rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.integer-maximum.disabled = true
max-connections = 10000 # Exceeds maximumlint.rules.integer-minimum
Check if the integer is greater than or equal to the minimum.
lint.rules.integer-minimum.disabled
Disable integer-minimum rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.integer-minimum.disabled = true
port = -1 # Below minimumlint.rules.integer-exclusive-maximum
Check if the integer is less than the maximum.
lint.rules.integer-exclusive-maximum.disabled
Disable integer-exclusive-maximum rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.integer-exclusive-maximum.disabled = true
value = 100 # Must be less than 100lint.rules.integer-exclusive-minimum
Check if the integer is greater than the minimum.
lint.rules.integer-exclusive-minimum.disabled
Disable integer-exclusive-minimum rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.integer-exclusive-minimum.disabled = true
value = 0 # Must be greater than 0lint.rules.integer-multiple-of
Check if the integer is a multiple of the value.
lint.rules.integer-multiple-of.disabled
Disable integer-multiple-of rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.integer-multiple-of.disabled = true
increment = 7 # Must be multiple of 5lint.rules.array-max-values
Check if the array has more than the maximum number of values.
lint.rules.array-max-values.disabled
Disable array-max-values rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.array-max-values.disabled = true
items = [1, 2, 3, 4, 5, 6] # Exceeds maxItemslint.rules.array-min-values
Check if the array has less than the minimum number of values.
lint.rules.array-min-values.disabled
Disable array-min-values rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.array-min-values.disabled = true
items = [] # Below minItemslint.rules.array-unique-values
Check if the array has duplicate values.
lint.rules.array-unique-values.disabled
Disable array-unique-values rule.
- Type:
boolean - Values:
true
# tombi: lint.rules.array-unique-values.disabled = true
tags = ["tag1", "tag2", "tag1"] # Duplicate values