A comprehensive style guide for writing consistent, maintainable Lua code across projects.
Lua Style Guide is a comprehensive set of coding conventions and best practices for the Lua programming language. It provides guidelines on syntax, formatting, naming, and architectural patterns to help developers write consistent and maintainable Lua code. The guide covers everything from basic types and tables to advanced topics like module design and testing strategies.
Lua developers working on team projects or open-source libraries who need to establish consistent coding standards. It's particularly valuable for organizations maintaining multiple Lua codebases where consistency improves collaboration and code quality.
Unlike generic style guides, this provides Lua-specific conventions with practical code examples for each guideline. It's maintained by experienced Lua developers and focuses on real-world concerns like nil handling, module patterns, and testing organization that directly impact code quality.
Olivine Labs Lua Style Guide
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Each guideline includes 'bad' and 'good' snippets, such as in the Tables section showing constructor syntax vs. property assignment, making rules easy to understand and apply.
Addresses Lua-specific quirks like nil handling in tables with an 'n' property recommendation and early validation in functions, based on practical scenarios from the README.
Provides specific advice on using the busted framework and organizing test files in a /spec folder, as detailed in the Testing section with example structures.
Focuses on uniform conventions without stylistic arguments, as stated in the philosophy, helping teams avoid subjective conflicts and maintain predictable code.
Mandates single quotes for strings and avoids semicolons, which might clash with other Lua style guides or developer preferences, even though the guide admits it doesn't argue for styles.
Lacks built-in linting tools or IDE configurations, requiring manual enforcement or integration with external tools like LuaCheck, which isn't covered in the README.
Does not address compatibility with different Lua versions (e.g., 5.1 vs. 5.4) or updates, potentially causing issues in projects using newer Lua features or legacy code.