All Projects → trixnz → Lua Fmt

trixnz / Lua Fmt

Licence: mit
lua-fmt is pretty-printer for Lua code

Programming Languages

typescript
32286 projects
lua
6591 projects

Labels

Projects that are alternatives of or similar to Lua Fmt

Plugin Php
Prettier PHP Plugin
Stars: ✭ 1,243 (+841.67%)
Mutual labels:  formatter
Codeview
Codeview is an Android library that lets you preview code in webview very easy and simple with highlights and colors.
Stars: ✭ 103 (-21.97%)
Mutual labels:  formatter
Javascript Number Formatter
Lightweight & Fast JavaScript Number Formatter
Stars: ✭ 119 (-9.85%)
Mutual labels:  formatter
Parallel Prettier
Concurrent prettier runner
Stars: ✭ 84 (-36.36%)
Mutual labels:  formatter
Kibana Object Format
A Kibana plugin for displaying objects and arrays of objects.
Stars: ✭ 100 (-24.24%)
Mutual labels:  formatter
Prettier
Prettier is an opinionated code formatter.
Stars: ✭ 41,411 (+31271.97%)
Mutual labels:  formatter
Elm Format
elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
Stars: ✭ 1,240 (+839.39%)
Mutual labels:  formatter
Vue Filters Kit
A collection of useful custom filters for Vue.js(v2.x.x) apps.
Stars: ✭ 125 (-5.3%)
Mutual labels:  formatter
Snowonder
🔮 Magical import declarations formatter for Xcode
Stars: ✭ 100 (-24.24%)
Mutual labels:  formatter
Javascriptprettier
A Visual Studio extension
Stars: ✭ 118 (-10.61%)
Mutual labels:  formatter
Phonenumberformatter
UITextField subclass for formatting phone numbers. Allow different formats for different countries(patterns).
Stars: ✭ 85 (-35.61%)
Mutual labels:  formatter
Laravel Oh Generators
This package extends the core file generators that are included with Laravel 5 or later.
Stars: ✭ 96 (-27.27%)
Mutual labels:  formatter
Pretty Yaml
PyYAML-based module to produce pretty and readable YAML-serialized data
Stars: ✭ 110 (-16.67%)
Mutual labels:  formatter
Black Playground
ambv/black online demo
Stars: ✭ 83 (-37.12%)
Mutual labels:  formatter
Auto Correct
Automatically add whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).
Stars: ✭ 122 (-7.58%)
Mutual labels:  formatter
Texttable
Swift package for easily rendering text tables. Inspired by the Python tabulate library.
Stars: ✭ 82 (-37.88%)
Mutual labels:  formatter
Swimat
An Xcode formatter plug-in to format your swift code.
Stars: ✭ 1,388 (+951.52%)
Mutual labels:  formatter
Messageformat.net
ICU MessageFormat implementation for .NET.
Stars: ✭ 129 (-2.27%)
Mutual labels:  formatter
Editorconfig Netbeans
A NetBeans IDE plugin supporting the EditorConfig standard. ⛺
Stars: ✭ 123 (-6.82%)
Mutual labels:  formatter
Atom Beautify
📣 Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | 💄 Universal beautification package for Atom editor (⚠️ Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding ❤️ )
Stars: ✭ 1,501 (+1037.12%)
Mutual labels:  formatter

Build Status NPM Package

Code Formatter for Lua

lua-fmt is pretty-printer for Lua code, written in TypeScript and deeply inspired by prettier. lua-fmt provides an interface to format Lua code that conforms to a single and consistent standard.

While not implemented yet, the interface will be customizable to tailor the output to the user's preferences: linebreaks, string style, etc.

Installing

  • npm install lua-fmt

Usage

API

import {formatText} from 'lua-fmt';
console.log(formatText('local hello = "Hello"; print(hello .. " world!")'))

Command Line

Format a single file:

  • luafmt test/lua-5.3.4-tests/calls.lua

Format a stream from stdin:

  • cat test/lua-5.3.4-tests/calls.lua | luafmt --stdin

TODO

  • [ ] Add support for a .luafmt preferences file

Testing

lua-fmt uses jest for automated testing.

Among the user-created tests in the test/ folder, a copy of the lua-5.3.4 tests are executed after formatting to ensure the code remains syntactically correct after formatting. For this reason, please do not modify the lua-5.3.4-tests folder unless updating with new tests from the official Lua tests. To run these tests, lua53 is expected to be available on the PATH.

When contributing changes, please consider writing tests to ensure they do not regress.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].