Skip to content

rules tool

Use rules to list the rules that match some filters, such as every pandas rule with an unsafe fix. It lists the rules of xpd and of the project, without their documentation, and rule reads one in full. package is a module name, such as numpy or sklearn.

rules(package=null, severity=null, fixable=null, query=null)
  • Changes no file
  • A second call with the same arguments changes nothing more
  • Stays inside the project

Tags: rules.

The server gives the agent this description of the tool.

List xpd's rules and package checks, without their documentation. Every filter is optional, and they combine. Use rule to read one rule with examples.

Type: string or null. Optional, default null.

Only this pack, by module name, such as pandas, numpy, scipy, sklearn, sklego, mapie, category_encoders, linearmodels, arch, pymoo or plotly.

Type: "error", "warning", "info", "hint" or null. Optional, default null.

Only rules of this severity.

Type: boolean or null. Optional, default null.

True for rules with a fix, False for rules without one.

Type: string or null. Optional, default null.

Only rules whose id, message or documentation contains this text, in any case.

Field Type Required Default Description
rules list of object yes
rules[].package string yes Module name of the pack, such as pandas or sklearn.
rules[].rule string yes
rules[].severity "error", "warning", "info", "hint" yes
rules[].message string yes
rules[].fix "safe", "unsafe" or null yes
rules[].since string or null yes The first library version the rule applies to.
rules[].url string or null yes The rule documentation URL, when supplied.
{"package":"pandas","query":"inplace"}

The result has rules. Each is shown with its name and its fix.

{"rules":[{"rule":"inplace-on-column","fix":"unsafe"},{"rule":"inplace-result-assigned","fix":"unsafe"},{"rule":"no-inplace","fix":"unsafe"}]}

No match is an empty list. The project's own rules that cannot be read fail with the binary's message.