An opinionated code formatter for Lua 5.1, 5.2, 5.3, 5.4 and Luau, built using full-moon. StyLua is inspired by the likes of prettier, it parses your Lua codebase, and prints it back out from scratch, enforcing a consistent code style. By default, these are built with all syntax variants enabled (Lua 5.2, 5.3, 5.4 and Luau), to cover all possible codebases. If you would like to format a specific Lua version only, see installing from crates.io. You can use the stylua-action GitHub Action in your CI to install and run StyLua. This action uses the prebuilt GitHub release binaries, instead of running cargo install, for faster CI times. This command will format the foo.lua and bar.lua file, and search down the src directory to format any files within it. StyLua can also read from stdin, by using - as the file name.

Features

  • There are multiple ways to install StyLua
  • You can use the stylua-action GitHub Action in your CI to install and run StyLua
  • You can use StyLua with pre-commit
  • StyLua is available on the Docker Hub
  • StyLua is available on macOS via the Homebrew package manager
  • Editor Integrations

Project Samples

Project Activity

See All Activity >

Categories

Code Formatters

License

Mozilla Public License 1.0 (MPL)

Follow StyLua

StyLua Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of StyLua!

Additional Project Details

Operating Systems

Linux, Windows

Programming Language

Rust

Related Categories

Rust Code Formatters

Registered

2023-04-25