GithubHelp home page GithubHelp logo

modelica-tools / mofmt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erykmroczek/mofmt

0.0 0.0 0.0 471 KB

Modelica code formatter

Home Page: https://github.com/ErykMroczek/mofmt

License: Mozilla Public License 2.0

Rust 89.72% Modelica 10.28%

mofmt's Introduction

mofmt - Modelica code formatter

mofmt is a code formatter for Modelica language. It aims to enhance readability and provide style constistency across different Modelica projects.

Code style applied by the mofmt is described in code-style.md.

mofmt assumes that files are encoded as UTF-8 (without BOM). Other encoding will cause it to panic.

Installation and usage

Installation

mofmt can be installed with cargo:

cargo install mofmt

or you can just grab one of the released libraries.

On top of that, repo contains a necessary pre-commit-hooks.yaml file, so if you are using Git, you can delegate running mofmt to pre-commit framework.

Usage

mofmt expects one or more paths that point to either Modelica source files, or to directories with such files:

mofmt <PATHS>

So you can format a single file:

mofmt foo.mo

or multiple files:

mofmt foo.mo bar.mo baz.mo

or all files inside the directory (mofmt searches for files recursively):

mofmt ./foo-dir

or all files inside multiple directories

mofmt ./foo-dir ./bar-dir

or you can mix both files and directories:

mofmt ./foo-dir foo.mo bar.mo ./bar-dir baz.mo

mofmt can run in check mode. In this mode files are not modified, instead mofmt checks the formatting in the original file, and reports an error in case of a failure:

mofmt --check <PATHS>

TODO

[ ] include HTML pretty-printer

License

MPL-2.0

Authors

Eryk Mroczek: [email protected]

mofmt's People

Contributors

erykmroczek avatar m-kessler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.