diff options
-rw-r--r-- | .lua-format | 27 | ||||
-rw-r--r-- | Makefile | 17 |
2 files changed, 44 insertions, 0 deletions
diff --git a/.lua-format b/.lua-format new file mode 100644 index 0000000..43ff46c --- /dev/null +++ b/.lua-format @@ -0,0 +1,27 @@ +column_limit: 100 +indent_width: 2 +use_tab: false +spaces_before_call: 1 +keep_simple_control_block_one_line: false +keep_simple_function_one_line: false +align_args: true +break_after_functioncall_lp: false +break_before_functioncall_rp: false +spaces_inside_functioncall_parens: false +spaces_inside_functiondef_parens: false +align_parameter: true +chop_down_parameter: false +break_after_functiondef_lp: false +break_before_functiondef_rp: false +align_table_field: true +break_after_table_lb: true +break_before_table_rb: true +chop_down_table: true +chop_down_kv_table: true +table_sep: "," +extra_sep_at_table_end: true +column_table_limit: 80 +spaces_inside_table_braces: false +break_after_operator: true +double_quote_to_single_quote: true +spaces_around_equals_in_field: true diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c43eeda --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: check format check-luacheck check-format + +LUA_FILES = $(wildcard *.lua) + +# bash's process substitution is used for check-format +SHELL := /bin/bash + +check: check-luacheck check-format + +check-luacheck: + luacheck --globals=vis -- $(LUA_FILES) + +check-format: + for f in $(LUA_FILES); do diff $$f <(lua-format $$f) >/dev/null; done + +format: + lua-format -i $(LUA_FILES) |