Skip to main content

A Collection of pre-commit hooks for MATLAB

Project description

GitHub release pre-commit.ci status lint-and-test Code style: black

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.0.0
    hooks:
    -   id: matlab-reflow-comments
        args: [--line-length=100]

Hooks

matlab-reflow-comments

Reflow comments (lines beginning with %) in MATLAB file(s) (*.m) to the specified line length.

Blank comment lines are passed back into the reformatted source code.

  • Specify line length with args: [--line-length=100] (Default: 75)
  • Ignore comments with inner indentation args: [--ignore-indented=True] (Default: True)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pre-commit-matlab-1.0.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pre_commit_matlab-1.0.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page