Inmanta Compile Data Reference#

This page documents the compile data output when compiling with the –export-compile-data flag. The structure of this JSON is defined by inmanta.data.model.CompileData which inherits from pydantic.BaseModel. To produce the JSON representation of the object, model.json() is called. See the pydantic documentation for more information on how exactly a JSON is generated from a model.

class inmanta.data.model.CompileData(*, errors: list[Error])[source]#

Bases: BaseModel

Top level structure of compiler data to be exported.

errors: list[Error]#

All errors occurred while trying to compile.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'errors': FieldInfo(annotation=list[Error], required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class inmanta.ast.export.Error(*, category: ErrorCategory = ErrorCategory.runtime, type: str, message: str, location: Location | None = None, **extra_data: Any)[source]#

Bases: BaseModel

Error occurred while trying to compile.

category: ErrorCategory#

Category of this error.

location: Location | None#

Location where this error occurred.

message: str#

Error message.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'category': FieldInfo(annotation=ErrorCategory, required=False, default=<ErrorCategory.runtime: 'runtime_error'>), 'location': FieldInfo(annotation=Union[Location, NoneType], required=False), 'message': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

type: str#

Fully qualified name of the actual exception.

class inmanta.ast.export.ErrorCategory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

Category of an error.

parser = 'parse_error'#

Error occurred while parsing.

plugin = 'plugin_exception'#

A plugin explicitly raised an inmanta.plugins.PluginException.

runtime = 'runtime_error'#

Error occurred after parsing.

class inmanta.ast.export.Location(*, uri: str, range: Range)[source]#

Bases: BaseModel

Location in a file. Based on the LSP spec 3.15

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'range': FieldInfo(annotation=Range, required=True), 'uri': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

range: Range#
uri: str#
class inmanta.ast.export.Range(*, start: Position, end: Position)[source]#

Bases: BaseModel

Range in a file. Based on the LSP spec 3.15

end: Position#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'end': FieldInfo(annotation=Position, required=True), 'start': FieldInfo(annotation=Position, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

start: Position#
class inmanta.ast.export.Position(*, line: int, character: int)[source]#

Bases: BaseModel

Position in a file. Based on the LSP spec 3.15

character: int#
line: int#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'character': FieldInfo(annotation=int, required=True), 'line': FieldInfo(annotation=int, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.