@@ -55,6 +55,9 @@ class Config(ToDictMixin):
5555 """Configuration object.
5656 A configuration object contains all the information XRLint
5757 needs to execute on a set of dataset files.
58+
59+ You should not use the class constructor directly.
60+ Instead, use the `Config.from_value()` function.
5861 """
5962
6063 name : str | None = None
@@ -79,33 +82,33 @@ class Config(ToDictMixin):
7982 """
8083
8184 linter_options : dict [str , Any ] | None = None
82- """An object containing options related to the linting process."""
85+ """A dictionary containing options related to the linting process."""
8386
8487 opener_options : dict [str , Any ] | None = None
85- """An object containing options that are passed to
88+ """A dictionary containing options that are passed to
8689 the dataset opener.
8790 """
8891
8992 processor : Union ["ProcessorOp" , str , None ] = None
90- """processor - Either an object compatible with the `ProcessorOp`
93+ """Either an object compatible with the `ProcessorOp`
9194 interface or a string indicating the name of a processor inside
9295 of a plugin (i.e., `"pluginName/processorName"`).
9396 """
9497
9598 plugins : dict [str , "Plugin" ] | None = None
96- """An object containing a name-value mapping of plugin names to
99+ """A dictionary containing a name-value mapping of plugin names to
97100 plugin objects. When `files` is specified, these plugins are only
98101 available to the matching files.
99102 """
100103
101104 rules : dict [str , "RuleConfig" ] | None = None
102- """An object containing the configured rules.
105+ """A dictionary containing the configured rules.
103106 When `files` or `ignores` are specified, these rule configurations
104107 are only available to the matching files.
105108 """
106109
107110 settings : dict [str , Any ] | None = None
108- """An object containing name-value pairs of information
111+ """A dictionary containing name-value pairs of information
109112 that should be available to all rules.
110113 """
111114
@@ -117,8 +120,8 @@ def from_value(cls, value: Any) -> "Config":
117120
118121 Args:
119122 value: A `Config` object, a `dict` containing the
120- configuration properties, or `None` which
121- converts into an empty configuration.
123+ configuration properties, or `None` which
124+ converts into an empty configuration.
122125 Returns:
123126 A `Config` object.
124127 """
@@ -161,16 +164,27 @@ def global_ignores(self) -> list[str]:
161164 if self .ignores
162165 and not (
163166 self .files
164- or self .rules
165- or self .plugins
166- or self .settings
167167 or self .linter_options
168168 or self .opener_options
169+ or self .plugins
170+ or self .rules
171+ or self .settings
169172 )
170173 else []
171174 )
172175
173176 def get_rule (self , rule_id : str ) -> "Rule" :
177+ """Get the rule for the given rule identifier `rule_id`.
178+
179+ Args:
180+ rule_id: The rule identifier including plugin namespace, if any.
181+ Format `<rule-name>` (builtin rules) or `<plugin-name>/<rule-name>`.
182+ Returns:
183+ A `Rule` object.
184+ Raises:
185+ ValueError: If either the plugin is unknown in this configuration
186+ or the rule name is unknown.
187+ """
174188 if "/" in rule_id :
175189 plugin_name , rule_name = rule_id .split ("/" , maxsplit = 1 )
176190 else :
@@ -333,7 +347,11 @@ def merge_configs(
333347
334348@dataclass (frozen = True )
335349class ConfigList :
336- """A holder for a list of `Config` objects."""
350+ """A holder for a list of `Config` objects.
351+
352+ You should not use the class constructor directly.
353+ Instead, use the `ConfigList.from_value()` function.
354+ """
337355
338356 configs : list [Config ] = field (default_factory = list )
339357 """The list of `Config` objects."""
0 commit comments