Skip to content

pre-commit hook to format and check lua files using stylua and luacheck.

License

Notifications You must be signed in to change notification settings

rwxcorp/pre-commit-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pre-commit-lua

pre-commit hook to format and check lua files using stylua and luacheck.

Usage

This hook is meant to be used with pre-commit.

Prerequisites

Before using pre-commit-lua, ensure that you have luacheck and stylua installed on your system. If you don't have them installed, follow the instructions below:

Installing luacheck

  • Using LuaRocks:
luarocks install luacheck
  • Using package manager (example for Ubuntu):
sudo apt install luacheck

Installing stylua

  • Using Cargo (Rust's package manager):
cargo install stylua
  • Using precompiled binaries:
    • Visit the StyLua GitHub repository.
    • Download the precompiled binary for your operating system.
    • Place the binary in a directory accessible from your system's PATH.

Configuration

Add the following hook to .pre-commit-config.yaml:

  - repo: https://github.com/rwxcorp/pre-commit-lua.git
    rev: v1.0.0
    hooks:
      - id: stylua
      - id: luacheck

License

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

About

pre-commit hook to format and check lua files using stylua and luacheck.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages