system
ruff_sync.system ¶
System and subprocess utilities for ruff-sync.
get_ruff_rule_markdown
async
¶
Execute ruff rule <CODE> and return the Markdown documentation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rule_code
|
str
|
The Ruff rule code (e.g., 'RUF012'). |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The Markdown documentation for the rule, or None if the execution fails |
str | None
|
or the rule is not found. |
Source code in src/ruff_sync/system.py
get_ruff_config_markdown
async
¶
Execute ruff config <SETTING> and return the Markdown documentation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_path
|
str
|
The Ruff configuration setting path (e.g., 'lint.select'). |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The Markdown documentation for the setting, or None if the execution fails. |
Source code in src/ruff_sync/system.py
get_all_ruff_rules
async
¶
Execute ruff rule --all --output-format json and return the parsed rules.
Returns:
| Type | Description |
|---|---|
list[RuffRule]
|
A list of dictionaries representing all supported Ruff rules. |
Source code in src/ruff_sync/system.py
get_ruff_linters
async
¶
Execute ruff linter --output-format json and return the parsed linters.
Returns:
| Type | Description |
|---|---|
list[RuffLinter]
|
A list of dictionaries representing Ruff linter categories. |
Source code in src/ruff_sync/system.py
compute_effective_rules ¶
Determine the status (Enabled, Ignored, Disabled) for each rule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_rules
|
list[RuffRule]
|
The list of all supported rules. |
required |
toml_config
|
Mapping[str, Any]
|
The local configuration dictionary. |
required |
Returns:
| Type | Description |
|---|---|
list[RuffRule]
|
The list of rules enriched with a 'status' key. |