A pre-commit hook to validate MATLAB code.
Project description
pre-commit-matlab-lint
A pre-commit hook for validating MATLAB code.
Available Hook
lint-matlab
Validate MATLAB files by analyzing them with MATLAB's checkcode function.
In order to use this hook, MATLAB must be installed and registered. There are three ways to specify which MATLAB instance should be used:
- Use
--matlab-home-path=PATHto supply the full path to a MATLAB home directory (e.g. "/Applications/MATLAB_R2021a.app" on macOS, "C:\Program Files\MATLAB\R2021a" on Windows) - Use
--matlab-version=VERSIONto specify a MATLAB version to locate (e.g. "9.10") - Use
--matlab-release-name=NAMEto specify a MATLAB release to locate (e.g. "R2021a")
Other options:
- Use
--treat-warning-as-errorto fail on linter warnings, in addition to linter errors. - Use
--enable-cyclomaticityto enable McCabe cyclomaticity complexity calculation display for each file. - Use
--enable-modified-cyclomaticityto enable modified cyclomaticity complexity calculation display for each file. - Use
--ignore-ok-pragmasto ignore%#okcheckcode suppression pragmas in files. - Use
--checkode-config-file=FILEto specify a settings file. For instructions detail how to create the file, see Save and Reuse Code Analyzer Message Settings. - Use
--use-default-checkcode-configto ignore any checkcode settings files and use factory defaults.
Usage with pre-commit
Add this to your .pre-commit-config.yaml
- repo: https://github.com/tcumby/pre-commit-matlab-lint
rev: "" # Use the sha / tag you want to point at
hooks:
- id: lint-matlab
args: ["--matlab_release_name=R2021a"]
Licensed under the terms of the MIT License. New issues and pull requests are welcome. Please refer to the contributing guide and security policy. Generated with Tyrannosaurus and converted to use uv.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file precommitmatlablint-1.0.9.tar.gz.
File metadata
- Download URL: precommitmatlablint-1.0.9.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40dd783de4e4fa9fba0afc8b3d4316e1823fdea02a8536f36463e771f7b41eb3
|
|
| MD5 |
48d28fd003eb470d26554887f5863b63
|
|
| BLAKE2b-256 |
2b7bbf4463b2962a004d070efa96b2526371e1b4062161dd17844ca69c728251
|
File details
Details for the file precommitmatlablint-1.0.9-py3-none-any.whl.
File metadata
- Download URL: precommitmatlablint-1.0.9-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efa5e4fa6b928dea76b3e3e93023141737ae32a51deee801d34d9f2fd104b49a
|
|
| MD5 |
a1afefb8e545fff3bd1ec61a91f88055
|
|
| BLAKE2b-256 |
8ddce23cbb6094464958fbe6b077138f238fce40d6d5e1a3372bf45d06fdf0d9
|