aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2021-03-20 12:31:21 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2021-03-20 12:31:21 +0100
commit92cff24d4a19f2d37eb8e2525b23b92d78b1eee0 (patch)
tree6a4fa7c500d18a28bdef1ba2e5d9bd95125cf4fe
parent127b82059475fbd357de5ee11030669e8e0fbc65 (diff)
downloadvis-spellcheck-92cff24d4a19f2d37eb8e2525b23b92d78b1eee0.tar.gz
add Makefile and lua-format style definition
-rw-r--r--.lua-format27
-rw-r--r--Makefile17
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)