malt 0.1.0__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.
malt/__init__.py ADDED
@@ -0,0 +1,9 @@
1
+ """malt: an ultra-fast MATLAB linter.
2
+
3
+ The wheel ships the native ``malt`` executable; this package only locates it so
4
+ that ``python -m malt`` works in addition to the ``malt`` console command.
5
+ """
6
+
7
+ from malt._find_malt import find_malt_bin
8
+
9
+ __all__ = ["find_malt_bin"]
malt/__main__.py ADDED
@@ -0,0 +1,22 @@
1
+ """Run the bundled ``malt`` executable: ``python -m malt [args...]``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import subprocess
7
+ import sys
8
+
9
+ from malt._find_malt import find_malt_bin
10
+
11
+
12
+ def main() -> None:
13
+ """Replace this process with ``malt`` (or wait for it on Windows)."""
14
+ malt = find_malt_bin()
15
+ if sys.platform == "win32":
16
+ # Windows has no exec(); forward the exit code instead.
17
+ sys.exit(subprocess.run([malt, *sys.argv[1:]]).returncode)
18
+ os.execvp(malt, [malt, *sys.argv[1:]])
19
+
20
+
21
+ if __name__ == "__main__":
22
+ main()
malt/_find_malt.py ADDED
@@ -0,0 +1,39 @@
1
+ """Locate the ``malt`` executable installed alongside this package."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import sys
7
+ import sysconfig
8
+ from pathlib import Path
9
+
10
+
11
+ def find_malt_bin() -> str:
12
+ """Return the path to the ``malt`` executable shipped with this package.
13
+
14
+ Raises:
15
+ FileNotFoundError: If the executable cannot be found.
16
+ """
17
+ exe = "malt.exe" if sys.platform == "win32" else "malt"
18
+
19
+ candidates: list[Path] = [Path(sysconfig.get_path("scripts")) / exe]
20
+
21
+ # `pip install --user` places scripts in the user scheme instead.
22
+ user_scheme = {
23
+ "nt": "nt_user",
24
+ "posix": "osx_framework_user" if sys.platform == "darwin" else "posix_user",
25
+ }.get(os.name)
26
+ if user_scheme and user_scheme in sysconfig.get_scheme_names():
27
+ candidates.append(Path(sysconfig.get_path("scripts", scheme=user_scheme)) / exe)
28
+
29
+ # `pip install --target <dir>` puts scripts in <dir>/bin next to the package.
30
+ candidates.append(Path(__file__).resolve().parent.parent / "bin" / exe)
31
+
32
+ for candidate in candidates:
33
+ if candidate.is_file():
34
+ return str(candidate)
35
+
36
+ searched = ", ".join(str(c) for c in candidates)
37
+ raise FileNotFoundError(
38
+ f"could not find the malt executable (searched: {searched})"
39
+ )
malt/py.typed ADDED
File without changes
Binary file
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.4
2
+ Name: malt
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Rust
17
+ Classifier: Topic :: Software Development :: Quality Assurance
18
+ License-File: LICENSE
19
+ Summary: An ultra-fast MATLAB linter with MATLAB Code Analyzer-compatible checks, written in Rust
20
+ Keywords: matlab,linter,lint,static-analysis,code-analyzer
21
+ Home-Page: https://watermarkhu.nl/malt
22
+ Author-email: Mark Shui Hu <watermarkhu@gmail.com>
23
+ License-Expression: MIT
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
26
+ Project-URL: Changelog, https://github.com/watermarkhu/malt/releases
27
+ Project-URL: Documentation, https://watermarkhu.nl/malt
28
+ Project-URL: Homepage, https://watermarkhu.nl/malt
29
+ Project-URL: Repository, https://github.com/watermarkhu/malt
30
+
31
+ # malt
32
+
33
+ An ultra-fast, extensible linter for MATLAB, written in Rust.
34
+
35
+ `malt` parses MATLAB with tree-sitter and runs every rule in a
36
+ single pass over the syntax tree. It aims for parity with MATLAB's Code Analyzer
37
+ and uses the same check IDs (`NOSEMI`, `AGROW`, `naming.class.casing`, ...), so
38
+ existing `%#ok<...>` suppressions keep working.
39
+
40
+ ## Install
41
+
42
+ | Channel | Command |
43
+ | ------- | ------- |
44
+ | PyPI | `pip install malt` or `uv tool install malt` (or run once with `uvx malt`) |
45
+ | crates.io | `cargo install malt-cli` |
46
+ | npm (WebAssembly) | `npm install malt-wasm` |
47
+
48
+ PyPI and crates.io install the same `malt` command; the npm package is a
49
+ WebAssembly library for browsers and Node.js.
50
+
51
+ ## Usage
52
+
53
+ ```bash
54
+ malt src/ # lint a directory
55
+ malt --fix src/foo.m # apply automatic fixes
56
+ malt --preset all src/ # enable every rule
57
+ ```
58
+
59
+ Configure rules in a `.malt.toml` at the project root:
60
+
61
+ ```toml
62
+ [lint]
63
+ preset = "recommended"
64
+
65
+ [lint.rules]
66
+ NOSEMI = "off"
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ Full documentation, the rule reference and an in-browser playground are at
72
+ <https://watermarkhu.nl/malt>.
73
+
74
+ ## License
75
+
76
+ MIT
77
+
@@ -0,0 +1,10 @@
1
+ malt/__init__.py,sha256=7KfnSpnh5rG7-neexWwVw4x_6NQvbh6HrhHhDhPDuUI,279
2
+ malt/__main__.py,sha256=-tmRHBcK580yZRoLdQTmCxgtJO1kTh-wd7asn-Kan80,583
3
+ malt/_find_malt.py,sha256=MdEdEXRZnLCFMmWHeppNyKKHbsmwf0t4Ay60WDsIduo,1328
4
+ malt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ malt-0.1.0.data/scripts/malt.exe,sha256=-SDyE5eKbJXo_BwT9JG5nIJaLuNTW2Q6NC5qRv5NxeE,4968960
6
+ malt-0.1.0.dist-info/METADATA,sha256=TrF8uFK7HetD-DFGzFetV6plT6Pk4RsYAxLdzNu-whw,2523
7
+ malt-0.1.0.dist-info/WHEEL,sha256=NMcgpbgSQKFPcOlxqemqcJWw9mOLJ5cWmlwQILii2R4,94
8
+ malt-0.1.0.dist-info/licenses/LICENSE,sha256=S64LYCdW9sVF8C_B1tcyYXHC5y_nGwPNMWe8pghhlQI,1090
9
+ malt-0.1.0.dist-info/sboms/malt-cli.cyclonedx.json,sha256=uxi87e9Kh-H8RtO1HftsbgIqr38CQiIvc_CCmajXsy0,60783
10
+ malt-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_arm64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mark Shui Hu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.