aboutsummaryrefslogtreecommitdiffstats
path: root/.luacheckrc
diff options
context:
space:
mode:
Diffstat (limited to '.luacheckrc')
-rw-r--r--.luacheckrc127
1 files changed, 105 insertions, 22 deletions
diff --git a/.luacheckrc b/.luacheckrc
index 91face3f..6aff9301 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -1,19 +1,34 @@
cache = true
-read_globals = { "prosody", "hosts", "import" }
-globals = { "_M" }
-allow_defined_top = true
-module = true
unused_secondaries = false
codes = true
-ignore = { "411/err", "421/err", "411/ok", "421/ok", "211/_ENV", "431/log" }
+ignore = { "411/err", "421/err", "411/ok", "421/ok", "211/_ENV", "431/log", "143/table", "113/unpack" }
max_line_length = 150
+read_globals = {
+ "prosody",
+ "import",
+};
+files["prosody"] = {
+ allow_defined_top = true;
+ module = true;
+}
+files["prosodyctl"] = {
+ allow_defined_top = true;
+ module = true;
+};
files["core/"] = {
- read_globals = { "prosody", "hosts" };
- globals = { "prosody.hosts.?", "hosts.?" };
+ globals = {
+ "prosody.hosts.?",
+ };
+}
+files["util/"] = {
+ -- Ignore unwrapped license text
+ max_comment_line_length = false;
}
files["plugins/"] = {
+ module = true;
+ allow_defined_top = true;
read_globals = {
-- Module instance
"module.name",
@@ -51,8 +66,6 @@ files["plugins/"] = {
"module.get_option_set",
"module.get_option_string",
"module.handle_items",
- "module.has_feature",
- "module.has_identity",
"module.hook",
"module.hook_global",
"module.hook_object_event",
@@ -74,10 +87,11 @@ files["plugins/"] = {
"module.wrap_event",
"module.wrap_global",
"module.wrap_object_event",
+
+ -- mod_http API
+ "module.http_url",
};
globals = {
- "_M",
-
-- Methods that can be set on module API
"module.unload",
"module.add_host",
@@ -89,16 +103,85 @@ files["plugins/"] = {
"module.environment",
};
}
-files["tests/"] = {
- read_globals = {
- "testlib_new_env",
- "assert_equal",
- "assert_table",
- "assert_function",
- "assert_string",
- "assert_boolean",
- "assert_is",
- "assert_is_not",
- "runtest",
+files["spec/"] = {
+ std = "+busted"
+}
+files["prosody.cfg.lua"] = {
+ ignore = { "131" };
+ globals = {
+ "Host",
+ "host",
+ "VirtualHost",
+ "Component",
+ "component",
+ "Include",
+ "include",
+ "RunScript"
};
}
+
+if os.getenv("PROSODY_STRICT_LINT") ~= "1" then
+ -- These files have not yet been brought up to standard
+ -- Do not add more files here, but do help us fix these!
+ exclude_files = {
+ "doc/net.server.lua";
+
+ "fallbacks/bit.lua";
+ "fallbacks/lxp.lua";
+
+ "net/adns.lua";
+ "net/cqueues.lua";
+ "net/dns.lua";
+ "net/server_select.lua";
+
+ "plugins/mod_admin_adhoc.lua";
+ "plugins/mod_admin_telnet.lua";
+ "plugins/mod_announce.lua";
+ "plugins/mod_bosh.lua";
+ "plugins/mod_groups.lua";
+ "plugins/mod_http_files.lua";
+ "plugins/mod_http.lua";
+ "plugins/mod_legacyauth.lua";
+ "plugins/mod_net_multiplex.lua";
+ "plugins/mod_pep.lua";
+ "plugins/mod_pep_plus.lua";
+ "plugins/mod_privacy.lua";
+ "plugins/mod_pubsub/pubsub.lib.lua";
+ "plugins/mod_s2s/mod_s2s.lua";
+ "plugins/mod_s2s/s2sout.lib.lua";
+ "plugins/mod_storage_sql1.lua";
+ "plugins/mod_storage_sql.lua";
+ "plugins/mod_websocket.lua";
+
+ "spec/core_configmanager_spec.lua";
+ "spec/core_moduleapi_spec.lua";
+ "spec/net_http_parser_spec.lua";
+ "spec/util_cache_spec.lua";
+ "spec/util_events_spec.lua";
+ "spec/util_http_spec.lua";
+ "spec/util_ip_spec.lua";
+ "spec/util_json_spec.lua";
+ "spec/util_multitable_spec.lua";
+ "spec/util_rfc6724_spec.lua";
+ "spec/util_throttle_spec.lua";
+ "spec/util_xmppstream_spec.lua";
+
+ "tools/ejabberd2prosody.lua";
+ "tools/ejabberdsql2prosody.lua";
+ "tools/erlparse.lua";
+ "tools/jabberd14sql2prosody.lua";
+ "tools/migration/migrator.cfg.lua";
+ "tools/migration/migrator/jabberd14.lua";
+ "tools/migration/migrator/mtools.lua";
+ "tools/migration/migrator/prosody_files.lua";
+ "tools/migration/migrator/prosody_sql.lua";
+ "tools/migration/prosody-migrator.lua";
+ "tools/openfire2prosody.lua";
+ "tools/xep227toprosody.lua";
+
+ "util/sasl/digest-md5.lua";
+ }
+else
+ max_cyclomatic_complexity = 50
+ max_line_length = 120
+end