This project has been archived by its maintainers, and is no longer receiving any updates.
pre-commit-matlab
A collection of pre-commit hooks for MATLAB
Ok... it's just one hook so far but maybe someday there will be more 😃
Using pre-commit-matlab with pre-commit
Add this to your .pre-commit-config.yaml
- repo: https://github.com/sco1/pre-commit-matlab
rev: v1.2.0
hooks:
- id: matlab-reflow-comments
args: [--line-length=100]
Hooks
matlab-reflow-comments
Reflow inline comments (lines beginning with %) or block comments (delimited by %{ and %}) in MATLAB file(s) (*.m) to the specified line length.
Blank comment lines are passed back into the reformatted source code.
- Use
--line-lengthto specify line length. (Default:75) - Use
--reflow-block-commentsto control block comment reflow. (Default:True) - Use
--ignore-indentedto ignore comments with inner indentation. (Default:True)- NOTE: This logic is not applied to the contents of a block comment.
- Use
--alternate-capital-handlingto treat comment lines that begin with a capital letter as the start of a new comment block. (Default:False)- NOTE: This logic is not applied to the contents of a block comment.
If ignore-indented is True, comments that contain inner indentation of at least two spaces is passed back into the reformatted source code as-is. Leading whitespace in the line is not considered.
For example:
% This is not indented
% This is not indented
% This is indented
% This is indented
If alternate-capital-handling is True, if the line buffer has contents then a line beginning with a capital letter is treated as the start of a new comment block.
For example:
% This is a comment line
% This is a second comment line that will not be reflowed into the previous line
NOTE: As an opinionated flag, this may lead to false positives so it is off by default. If enabled, pay close attention to the resulting diff to ensure that your comments are being reflowed as desired.
Metadata
Release files for pre-commit-matlab 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pre-commit-matlab-1.2.0.tar.gz | 5.7 kB | Without provenance | Details for pre-commit-matlab-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pre_commit_matlab-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for pre_commit_matlab-1.2.0-py3-none-any.whl |
Total release size: 11.7 kB
Release files / pre-commit-matlab-1.2.0.tar.gz
| Download URL | pre-commit-matlab-1.2.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffe9f4cded98f4119899f28dd4b0934ab0094701b3dfcfd8152709c00715a085
|
|
BLAKE2b-256 checksum How to use checksums |
13576e773efba57f2058361883eb069770752790a5c04882904babe0c74b2df4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / pre_commit_matlab-1.2.0-py3-none-any.whl
| Download URL | pre_commit_matlab-1.2.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49b2c440f741aee360630458c398e0d43ce2d709e398b1cd2a2a64b18925993a
|
|
BLAKE2b-256 checksum How to use checksums |
8985f5e568a5e671b022cae585cd16d61b4276965b04e8cea2d006b03fc0a616
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for pre-commit-matlab 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.