intentumdiff-python 0.0.1__py3-none-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- intentumdiff/__init__.py +134 -0
- intentumdiff/_differ_gate.py +210 -0
- intentumdiff/_differ_presentation.py +786 -0
- intentumdiff/_differ_runtime.py +320 -0
- intentumdiff/analysis/__init__.py +1 -0
- intentumdiff/analysis/compile_commands.py +151 -0
- intentumdiff/analysis/cross_file.py +71 -0
- intentumdiff/analysis/diagnostics.py +309 -0
- intentumdiff/analysis/guardrail_reports.py +254 -0
- intentumdiff/analysis/guardrails.py +318 -0
- intentumdiff/analysis/invariances.py +1207 -0
- intentumdiff/analysis/keyed_profiles.py +25 -0
- intentumdiff/analysis/resource_profiles.py +14 -0
- intentumdiff/analysis/schema_resolver.py +816 -0
- intentumdiff/analysis/text_review.py +46 -0
- intentumdiff/analysis/user_schemas.py +430 -0
- intentumdiff/assets.py +45 -0
- intentumdiff/cache/__init__.py +37 -0
- intentumdiff/cache/duckdb_store.py +98 -0
- intentumdiff/cache/sqlite_store.py +149 -0
- intentumdiff/cache/store.py +190 -0
- intentumdiff/cli/__init__.py +199 -0
- intentumdiff/cli/_commands.py +2141 -0
- intentumdiff/cli/_parser.py +1061 -0
- intentumdiff/cli/_shared.py +644 -0
- intentumdiff/content_type.py +59 -0
- intentumdiff/core/__init__.py +1 -0
- intentumdiff/core/commit_differ.py +599 -0
- intentumdiff/core/config.py +51 -0
- intentumdiff/core/cst_serializer.py +101 -0
- intentumdiff/core/diffignore.py +87 -0
- intentumdiff/core/index.py +189 -0
- intentumdiff/core/indexer.py +792 -0
- intentumdiff/core/models.py +837 -0
- intentumdiff/differ.py +2195 -0
- intentumdiff/github_app.py +287 -0
- intentumdiff/intentumdiff_rust_core/__init__.py +7 -0
- intentumdiff/intentumdiff_rust_core/ffi.py +8 -0
- intentumdiff/intentumdiff_rust_core/intentumdiff_rust_core.dll +0 -0
- intentumdiff/invariances/__init__.py +2 -0
- intentumdiff/invariances/rules.schema.json +283 -0
- intentumdiff/invariances/rules.yaml +349 -0
- intentumdiff/live_server.py +1314 -0
- intentumdiff/lsp/__init__.py +67 -0
- intentumdiff/lsp/client.py +544 -0
- intentumdiff/lsp/config.py +96 -0
- intentumdiff/lsp/enricher.py +227 -0
- intentumdiff/lsp/exceptions.py +27 -0
- intentumdiff/lsp/launcher.py +273 -0
- intentumdiff/lsp/servers.py +356 -0
- intentumdiff/lsp_server/__init__.py +14 -0
- intentumdiff/lsp_server/_codelens.py +67 -0
- intentumdiff/lsp_server/_diagnostics.py +62 -0
- intentumdiff/lsp_server/_handlers.py +175 -0
- intentumdiff/lsp_server/server.py +205 -0
- intentumdiff/plugins/__init__.py +1 -0
- intentumdiff/plugins/adapter.py +397 -0
- intentumdiff/plugins/builtins.py +323 -0
- intentumdiff/plugins/exceptions.py +93 -0
- intentumdiff/plugins/hub.py +1155 -0
- intentumdiff/plugins/language_metadata.py +250 -0
- intentumdiff/plugins/loader.py +1252 -0
- intentumdiff/plugins/registry.py +1079 -0
- intentumdiff/plugins/registry.schema.json +99 -0
- intentumdiff/plugins/registry_schema.py +280 -0
- intentumdiff/plugins/wit/plugin.wit +351 -0
- intentumdiff/rust_core.py +2370 -0
- intentumdiff/serve/__init__.py +19 -0
- intentumdiff/serve/_app.py +485 -0
- intentumdiff/serve/_static/index.html +326 -0
- intentumdiff/serve/_static/playground.js +567 -0
- intentumdiff/sources/__init__.py +1 -0
- intentumdiff/sources/base.py +28 -0
- intentumdiff/sources/file_source.py +48 -0
- intentumdiff/sources/git_source.py +375 -0
- intentumdiff/sources/live_buffer_source.py +113 -0
- intentumdiff/sources/patch_source.py +126 -0
- intentumdiff/sources/string_source.py +44 -0
- intentumdiff/testing.py +165 -0
- intentumdiff/vcs/__init__.py +37 -0
- intentumdiff/vcs/_safe_path.py +50 -0
- intentumdiff/vcs/base.py +136 -0
- intentumdiff/vcs/git_backend.py +97 -0
- intentumdiff/vcs/git_cli.py +100 -0
- intentumdiff/vcs/hg_backend.py +94 -0
- intentumdiff/vcs/perforce_backend.py +109 -0
- intentumdiff/vcs/svn_backend.py +105 -0
- intentumdiff/wasm/.gitkeep +2 -0
- intentumdiff/wasm/abap_parser.wasm +0 -0
- intentumdiff/wasm/adf_parser.wasm +0 -0
- intentumdiff/wasm/asciidoc_parser.wasm +0 -0
- intentumdiff/wasm/asm_parser.wasm +0 -0
- intentumdiff/wasm/assemblyscript_parser.wasm +0 -0
- intentumdiff/wasm/astro_parser.wasm +0 -0
- intentumdiff/wasm/bash_parser.wasm +0 -0
- intentumdiff/wasm/clojure_parser.wasm +0 -0
- intentumdiff/wasm/cmake_parser.wasm +0 -0
- intentumdiff/wasm/cpp_parser.wasm +0 -0
- intentumdiff/wasm/csharp_parser.wasm +0 -0
- intentumdiff/wasm/css_parser.wasm +0 -0
- intentumdiff/wasm/dart_parser.wasm +0 -0
- intentumdiff/wasm/databricks_parser.wasm +0 -0
- intentumdiff/wasm/dax_parser.wasm +0 -0
- intentumdiff/wasm/delphi_parser.wasm +0 -0
- intentumdiff/wasm/dockerfile_parser.wasm +0 -0
- intentumdiff/wasm/elixir_parser.wasm +0 -0
- intentumdiff/wasm/freebasic_parser.wasm +0 -0
- intentumdiff/wasm/generic_parser.wasm +0 -0
- intentumdiff/wasm/gitignore_parser.wasm +0 -0
- intentumdiff/wasm/go_parser.wasm +0 -0
- intentumdiff/wasm/gomod_parser.wasm +0 -0
- intentumdiff/wasm/graphql_parser.wasm +0 -0
- intentumdiff/wasm/groovy_parser.wasm +0 -0
- intentumdiff/wasm/haskell_parser.wasm +0 -0
- intentumdiff/wasm/html_parser.wasm +0 -0
- intentumdiff/wasm/ini_parser.wasm +0 -0
- intentumdiff/wasm/java_parser.wasm +0 -0
- intentumdiff/wasm/js_ts_parser.wasm +0 -0
- intentumdiff/wasm/json_parser.wasm +0 -0
- intentumdiff/wasm/kotlin_parser.wasm +0 -0
- intentumdiff/wasm/latex_parser.wasm +0 -0
- intentumdiff/wasm/lua_parser.wasm +0 -0
- intentumdiff/wasm/make_parser.wasm +0 -0
- intentumdiff/wasm/markdown_parser.wasm +0 -0
- intentumdiff/wasm/mdx_parser.wasm +0 -0
- intentumdiff/wasm/ocaml_parser.wasm +0 -0
- intentumdiff/wasm/odin_parser.wasm +0 -0
- intentumdiff/wasm/parser_manifest.json +590 -0
- intentumdiff/wasm/perl_parser.wasm +0 -0
- intentumdiff/wasm/php_parser.wasm +0 -0
- intentumdiff/wasm/plsql_parser.wasm +0 -0
- intentumdiff/wasm/po_parser.wasm +0 -0
- intentumdiff/wasm/postscript_parser.wasm +0 -0
- intentumdiff/wasm/powershell_parser.wasm +0 -0
- intentumdiff/wasm/proto_parser.wasm +0 -0
- intentumdiff/wasm/puppet_parser.wasm +0 -0
- intentumdiff/wasm/python_parser.wasm +0 -0
- intentumdiff/wasm/qsharp_parser.wasm +0 -0
- intentumdiff/wasm/r_parser.wasm +0 -0
- intentumdiff/wasm/reasonml_parser.wasm +0 -0
- intentumdiff/wasm/ruby_parser.wasm +0 -0
- intentumdiff/wasm/rust_parser.wasm +0 -0
- intentumdiff/wasm/sas_parser.wasm +0 -0
- intentumdiff/wasm/scala_parser.wasm +0 -0
- intentumdiff/wasm/scss_parser.wasm +0 -0
- intentumdiff/wasm/sql_parser.wasm +0 -0
- intentumdiff/wasm/squirrel_parser.wasm +0 -0
- intentumdiff/wasm/svelte_parser.wasm +0 -0
- intentumdiff/wasm/swift_parser.wasm +0 -0
- intentumdiff/wasm/terraform_parser.wasm +0 -0
- intentumdiff/wasm/toml_parser.wasm +0 -0
- intentumdiff/wasm/tsql_parser.wasm +0 -0
- intentumdiff/wasm/vbnet_parser.wasm +0 -0
- intentumdiff/wasm/vue_parser.wasm +0 -0
- intentumdiff/wasm/wat_parser.wasm +0 -0
- intentumdiff/wasm/xml_parser.wasm +0 -0
- intentumdiff/wasm/yaml_parser.wasm +0 -0
- intentumdiff/wasm/zig_parser.wasm +0 -0
- intentumdiff/watcher.py +259 -0
- intentumdiff_python-0.0.1.dist-info/METADATA +112 -0
- intentumdiff_python-0.0.1.dist-info/RECORD +165 -0
- intentumdiff_python-0.0.1.dist-info/WHEEL +4 -0
- intentumdiff_python-0.0.1.dist-info/entry_points.txt +80 -0
- intentumdiff_python-0.0.1.dist-info/licenses/LICENSE +21 -0
- intentumdiff_python-0.0.1.dist-info/sboms/intentumdiff-rust-core.cyclonedx.json +10968 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""
|
|
2
|
+
intentumdiff.vcs.perforce_backend
|
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
Perforce (Helix Core) VCS backend — a thin wrapper over the shared Rust VCS module
|
|
6
|
+
(#98, A2.4.4).
|
|
7
|
+
|
|
8
|
+
The Perforce operations (client-root discovery, blob read, changed-file listing, opened-file
|
|
9
|
+
status) live in the Rust core (``crates/rust-core-host/src/vcs_backend.rs``), which shells the
|
|
10
|
+
``p4`` CLI with tagged (``-ztag``) output; this class only marshals to/from the
|
|
11
|
+
:class:`ChangedFile` DTO. p4python is no longer used — the core is the single implementation
|
|
12
|
+
shared by every binding.
|
|
13
|
+
|
|
14
|
+
.. note:: **Breaking change (A2.4.4).** This backend previously took an injected, pre-connected
|
|
15
|
+
``P4`` object (p4python). It now shells the ``p4`` CLI, which resolves its connection the
|
|
16
|
+
standard Perforce way — from the environment (``P4PORT`` / ``P4USER`` / ``P4CLIENT``) or a
|
|
17
|
+
``P4CONFIG`` file discovered from the working directory — matching how the git/hg/svn
|
|
18
|
+
backends resolve their connection. The constructor no longer accepts a ``P4`` object.
|
|
19
|
+
|
|
20
|
+
Ref syntax
|
|
21
|
+
----------
|
|
22
|
+
``ref`` strings map to Perforce changelist numbers (as strings, e.g. ``"12345"``) or label
|
|
23
|
+
specs (e.g. ``"rel-1.0"``); depot paths (``//depot/...``) are validated in the core, which
|
|
24
|
+
rejects embedded ``@``/``#`` revision specifiers (an #88 filespec-injection control).
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
import os
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
|
|
32
|
+
from intentumdiff.vcs._safe_path import safe_working_tree_path
|
|
33
|
+
from intentumdiff.vcs.base import ChangedFile, VcsBackend
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class PerforceVcsBackend(VcsBackend):
|
|
37
|
+
"""Perforce VCS backend — thin wrapper over the Rust ``vcs_backend`` (p4 dialect).
|
|
38
|
+
|
|
39
|
+
Parameters
|
|
40
|
+
----------
|
|
41
|
+
repo_path:
|
|
42
|
+
Path to any directory inside the Perforce client workspace; the client root is
|
|
43
|
+
resolved by the core (``p4 info``) unless *client_root* is given. The ``p4`` CLI
|
|
44
|
+
resolves the server connection from the environment / ``P4CONFIG``.
|
|
45
|
+
client_root:
|
|
46
|
+
The local workspace (client) root path. When ``None``, resolved from ``p4 info``.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
_VCS = "p4"
|
|
50
|
+
|
|
51
|
+
def __init__(
|
|
52
|
+
self,
|
|
53
|
+
repo_path: str | os.PathLike[str] = ".",
|
|
54
|
+
client_root: str | os.PathLike[str] | None = None,
|
|
55
|
+
) -> None:
|
|
56
|
+
from intentumdiff import rust_core
|
|
57
|
+
|
|
58
|
+
if client_root is not None:
|
|
59
|
+
self._root = os.fspath(client_root)
|
|
60
|
+
else:
|
|
61
|
+
self._root = rust_core.vcs_backend_resolve_root(self._VCS, os.fspath(repo_path))
|
|
62
|
+
|
|
63
|
+
# ------------------------------------------------------------------
|
|
64
|
+
# VcsBackend implementation
|
|
65
|
+
# ------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
def get_blob(self, path: str, ref: str) -> str:
|
|
68
|
+
"""Return file content at Perforce changelist/label *ref* ("" when absent).
|
|
69
|
+
|
|
70
|
+
*path* is a depot path (e.g. ``//depot/main/src/foo.py``); the core joins it with the
|
|
71
|
+
``@ref`` revision specifier and runs ``p4 print``.
|
|
72
|
+
"""
|
|
73
|
+
from intentumdiff import rust_core
|
|
74
|
+
|
|
75
|
+
return rust_core.vcs_backend_get_blob(self._VCS, self._root, path, ref)
|
|
76
|
+
|
|
77
|
+
def list_changed_files(self, ref_a: str, ref_b: str) -> list[ChangedFile]:
|
|
78
|
+
"""Return files changed between Perforce changelists *ref_a* and *ref_b*."""
|
|
79
|
+
from intentumdiff import rust_core
|
|
80
|
+
|
|
81
|
+
return [
|
|
82
|
+
ChangedFile(**row)
|
|
83
|
+
for row in rust_core.vcs_backend_changed_files(
|
|
84
|
+
self._VCS, self._root, ref_a, ref_b
|
|
85
|
+
)
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
def get_working_file(self, path: str) -> str:
|
|
89
|
+
"""Return on-disk content of *path* (relative to the workspace root)."""
|
|
90
|
+
full_path = safe_working_tree_path(self._root, path)
|
|
91
|
+
try:
|
|
92
|
+
return full_path.read_text(encoding="utf-8", errors="replace")
|
|
93
|
+
except FileNotFoundError:
|
|
94
|
+
return ""
|
|
95
|
+
|
|
96
|
+
def list_working_tree_changes(self, ref: str = "default") -> list[ChangedFile]:
|
|
97
|
+
"""Return files opened in the default pending changelist (``p4 opened``)."""
|
|
98
|
+
from intentumdiff import rust_core
|
|
99
|
+
|
|
100
|
+
return [
|
|
101
|
+
ChangedFile(**row)
|
|
102
|
+
for row in rust_core.vcs_backend_working_tree_changes(
|
|
103
|
+
self._VCS, self._root, ref
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
def resolve_root(self) -> Path:
|
|
108
|
+
"""Return the Perforce workspace (client) root path."""
|
|
109
|
+
return Path(self._root)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""
|
|
2
|
+
intentumdiff.vcs.svn_backend
|
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
Subversion VCS backend — a thin wrapper over the shared Rust VCS module (#98, A2.4.4).
|
|
6
|
+
|
|
7
|
+
The Subversion operations (root discovery, blob read, changed-file listing, ``svn --xml``
|
|
8
|
+
parsing) live in the Rust core (``crates/rust-core-host/src/vcs_backend.rs``), which shells the
|
|
9
|
+
``svn`` CLI directly; this class only marshals to/from the :class:`ChangedFile` DTO. The XML
|
|
10
|
+
parsing that used to run here (defusedxml) is gone — the core is the single implementation
|
|
11
|
+
shared by every binding. The working-tree file read stays here (plain disk I/O, not VCS logic).
|
|
12
|
+
|
|
13
|
+
Ref syntax
|
|
14
|
+
----------
|
|
15
|
+
``ref`` strings map directly to SVN revision syntax: ``"HEAD"``, ``"BASE"``, ``"PREV"``, or an
|
|
16
|
+
integer revision number as a string (e.g. ``"42"``). Revision inputs are validated in the core
|
|
17
|
+
(an #88 control).
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import os
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
|
|
25
|
+
from intentumdiff.vcs._safe_path import safe_relative_path, safe_working_tree_path
|
|
26
|
+
from intentumdiff.vcs.base import ChangedFile, VcsBackend
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class SvnVcsBackend(VcsBackend):
|
|
30
|
+
"""Subversion VCS backend — thin wrapper over the Rust ``vcs_backend`` (svn dialect).
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
working_copy:
|
|
35
|
+
Path to the SVN working copy root.
|
|
36
|
+
repo_url:
|
|
37
|
+
Repository URL (e.g. ``svn+ssh://svn.example.com/repos/proj``). When provided,
|
|
38
|
+
:meth:`get_blob` and :meth:`list_changed_files` target the repository URL directly (via
|
|
39
|
+
the core) and do not require the working copy to have the file checked out at that
|
|
40
|
+
revision.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
_VCS = "svn"
|
|
44
|
+
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
working_copy: str | os.PathLike[str],
|
|
48
|
+
repo_url: str | None = None,
|
|
49
|
+
) -> None:
|
|
50
|
+
# The caller supplies the working-copy root; the core resolves the true wc-root on
|
|
51
|
+
# demand (resolve_root) rather than eagerly, so a bare path is accepted here.
|
|
52
|
+
self._root = os.fspath(working_copy)
|
|
53
|
+
self._repo_url = repo_url
|
|
54
|
+
|
|
55
|
+
# ------------------------------------------------------------------
|
|
56
|
+
# VcsBackend implementation
|
|
57
|
+
# ------------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
def get_blob(self, path: str, ref: str) -> str:
|
|
60
|
+
"""Return file content at SVN revision *ref* ("" when absent)."""
|
|
61
|
+
from intentumdiff import rust_core
|
|
62
|
+
|
|
63
|
+
return rust_core.vcs_backend_get_blob(
|
|
64
|
+
self._VCS, self._root, safe_relative_path(path), ref, self._repo_url
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def list_changed_files(self, ref_a: str, ref_b: str) -> list[ChangedFile]:
|
|
68
|
+
"""Return files changed between SVN revisions *ref_a* and *ref_b*."""
|
|
69
|
+
from intentumdiff import rust_core
|
|
70
|
+
|
|
71
|
+
return [
|
|
72
|
+
ChangedFile(**row)
|
|
73
|
+
for row in rust_core.vcs_backend_changed_files(
|
|
74
|
+
self._VCS, self._root, ref_a, ref_b, self._repo_url
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
def get_working_file(self, path: str) -> str:
|
|
79
|
+
"""Return on-disk content of *path* in the SVN working copy."""
|
|
80
|
+
full_path = safe_working_tree_path(self._root, path)
|
|
81
|
+
try:
|
|
82
|
+
return full_path.read_text(encoding="utf-8", errors="replace")
|
|
83
|
+
except FileNotFoundError:
|
|
84
|
+
return ""
|
|
85
|
+
|
|
86
|
+
def list_working_tree_changes(self, ref: str = "BASE") -> list[ChangedFile]:
|
|
87
|
+
"""Return uncommitted local modifications (``svn status --xml``).
|
|
88
|
+
|
|
89
|
+
The default *ref* value ``"BASE"`` is the SVN equivalent of ``HEAD``; ``svn status``
|
|
90
|
+
always compares against ``BASE``, so *ref* is accepted only for interface compatibility.
|
|
91
|
+
"""
|
|
92
|
+
from intentumdiff import rust_core
|
|
93
|
+
|
|
94
|
+
return [
|
|
95
|
+
ChangedFile(**row)
|
|
96
|
+
for row in rust_core.vcs_backend_working_tree_changes(
|
|
97
|
+
self._VCS, self._root, ref
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
def resolve_root(self) -> Path:
|
|
102
|
+
"""Return the SVN working-copy root path (``svn info --show-item wc-root``)."""
|
|
103
|
+
from intentumdiff import rust_core
|
|
104
|
+
|
|
105
|
+
return Path(rust_core.vcs_backend_resolve_root(self._VCS, self._root))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|