{"id":15716456,"url":"https://github.com/sco1/pre-commit-matlab","last_synced_at":"2025-05-07T21:44:50.678Z","repository":{"id":37953356,"uuid":"376168421","full_name":"sco1/pre-commit-matlab","owner":"sco1","description":"A collection of pre-commit hooks (ok, just one) for MATLAB","archived":false,"fork":false,"pushed_at":"2025-04-08T02:19:15.000Z","size":188,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T00:30:39.360Z","etag":null,"topics":["matlab","pre-commit","pre-commit-hook","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sco1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sco1"}},"created_at":"2021-06-12T00:11:29.000Z","updated_at":"2025-04-08T19:50:32.000Z","dependencies_parsed_at":"2023-11-07T02:26:23.021Z","dependency_job_id":"b7c6de5b-d1e3-45f3-ba85-97064f93a40e","html_url":"https://github.com/sco1/pre-commit-matlab","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":"0.47540983606557374","last_synced_commit":"5a5761c3c79cb60e44611d63d5e92fba36478d65"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"sco1/py-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sco1%2Fpre-commit-matlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sco1%2Fpre-commit-matlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sco1%2Fpre-commit-matlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sco1%2Fpre-commit-matlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sco1","download_url":"https://codeload.github.com/sco1/pre-commit-matlab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961835,"owners_count":21832190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matlab","pre-commit","pre-commit-hook","python","python3"],"created_at":"2024-10-03T21:45:40.927Z","updated_at":"2025-05-07T21:44:50.655Z","avatar_url":"https://github.com/sco1.png","language":"Python","funding_links":["https://github.com/sponsors/sco1"],"categories":[],"sub_categories":[],"readme":"[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pre-commit-matlab/1.2.0?logo=python\u0026logoColor=FFD43B)](https://pypi.org/project/pre-commit-matlab/)\n[![PyPI](https://img.shields.io/pypi/v/pre-commit-matlab?logo=Python\u0026logoColor=FFD43B)](https://pypi.org/project/pre-commit-matlab/)\n[![PyPI - License](https://img.shields.io/pypi/l/pre-commit-matlab?color=magenta)](https://github.com/sco1/pre-commit-matlab/blob/master/LICENSE)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sco1/pre-commit-matlab/main.svg)](https://results.pre-commit.ci/latest/github/sco1/pre-commit-matlab/main)\n[![lint-and-test](https://github.com/sco1/pre-commit-matlab/actions/workflows/lint_test.yml/badge.svg?branch=main)](https://github.com/sco1/pre-commit-matlab/actions/workflows/lint_test.yml)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)\n# pre-commit-matlab\nA collection of [pre-commit](https://pre-commit.com/) hooks for MATLAB\n\nOk... it's just one hook so far but maybe someday there will be more 😃\n\n## Using pre-commit-matlab with pre-commit\nAdd this to your `.pre-commit-config.yaml`\n\n```yaml\n-   repo: https://github.com/sco1/pre-commit-matlab\n    rev: v1.2.0\n    hooks:\n    -   id: matlab-reflow-comments\n        args: [--line-length=100]\n```\n\n## Hooks\n### `matlab-reflow-comments`\nReflow inline comments (lines beginning with `%`) or block comments (delimited by `%{` and `%}`) in MATLAB file(s) (`*.m`) to the specified line length.\n\nBlank comment lines are passed back into the reformatted source code.\n\n* Use `--line-length` to specify line length. (Default: `75`)\n* Use `--reflow-block-comments` to control block comment reflow. (Default: `True`)\n* Use `--ignore-indented` to ignore comments with inner indentation. (Default: `True`)\n  * **NOTE:** This logic *is not* applied to the contents of a block comment.\n* Use `--alternate-capital-handling` to treat comment lines that begin with a capital letter as the start of a new comment block. (Default: `False`)\n  * **NOTE:** This logic *is not* applied to the contents of a block comment.\n\nIf `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.\n\nFor example:\n\n```matlab\n    % This is not indented\n% This is not indented\n%  This is indented\n%    This is indented\n```\n\nIf `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.\n\nFor example:\n\n```matlab\n% This is a comment line\n% This is a second comment line that will not be reflowed into the previous line\n```\n\n**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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsco1%2Fpre-commit-matlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsco1%2Fpre-commit-matlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsco1%2Fpre-commit-matlab/lists"}