.luacheckrc
author Matthew Wild <mwild1@gmail.com>
Wed, 15 Jun 2022 12:15:01 +0100
changeset 12646 9061f9621330
parent 12591 1332c650400d
child 12770 bde224616766
permissions -rw-r--r--
Switch to a new role-based authorization framework, removing is_admin() We began moving away from simple "is this user an admin?" permission checks before 0.12, with the introduction of mod_authz_internal and the ability to dynamically change the roles of individual users. The approach in 0.12 still had various limitations however, and apart from the introduction of roles other than "admin" and the ability to pull that info from storage, not much actually changed. This new framework shakes things up a lot, though aims to maintain the same functionality and behaviour on the surface for a default Prosody configuration. That is, if you don't take advantage of any of the new features, you shouldn't notice any change. The biggest change visible to developers is that usermanager.is_admin() (and the auth provider is_admin() method) have been removed. Gone. Completely. Permission checks should now be performed using a new module API method: module:may(action_name, context) This method accepts an action name, followed by either a JID (string) or (preferably) a table containing 'origin'/'session' and 'stanza' fields (e.g. the standard object passed to most events). It will return true if the action should be permitted, or false/nil otherwise. Modules should no longer perform permission checks based on the role name. E.g. a lot of code previously checked if the user's role was prosody:admin before permitting some action. Since many roles might now exist with similar permissions, and the permissions of prosody:admin may be redefined dynamically, it is no longer suitable to use this method for permission checks. Use module:may(). If you start an action name with ':' (recommended) then the current module's name will automatically be used as a prefix. To define a new permission, use the new module API: module:default_permission(role_name, action_name) module:default_permissions(role_name, { action_name[, action_name...] }) This grants the specified role permission to execute the named action(s) by default. This may be overridden via other mechanisms external to your module. The built-in roles that developers should use are: - prosody:user (normal user) - prosody:admin (host admin) - prosody:operator (global admin) The new prosody:operator role is intended for server-wide actions (such as shutting down Prosody). Finally, all usage of is_admin() in modules has been fixed by this commit. Some of these changes were trickier than others, but no change is expected to break existing deployments. EXCEPT: mod_auth_ldap no longer supports the ldap_admin_filter option. It's very possible nobody is using this, but if someone is then we can later update it to pull roles from LDAP somehow.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6670
e4338c0f739a .luacheckrc: Commit initial config for luacheck
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     1
cache = true
e4338c0f739a .luacheckrc: Commit initial config for luacheck
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     2
codes = true
12586
e72bb50456c4 Backport 875f73ead4e8 8e4033213c62 to deal with luacheck 0.26
Kim Alvefur <zash@zash.se>
parents: 12302
diff changeset
     3
ignore = { "411/err", "421/err", "411/ok", "421/ok", "211/_ENV", "431/log", "214", "581" }
6753
2a2eb30b1ed4 luacheckrc: Allow plugins to implement functions under module.* (module.load, etc.)
Matthew Wild <mwild1@gmail.com>
parents: 6670
diff changeset
     4
12591
1332c650400d luacheck: Set expected globals to Lua 5.4 + compat
Kim Alvefur <zash@zash.se>
parents: 12589
diff changeset
     5
std = "lua54c"
7951
ed99a8e3c260 luacheckrc: Set max line length to 150 for now [luacheck]
Kim Alvefur <zash@zash.se>
parents: 7875
diff changeset
     6
max_line_length = 150
ed99a8e3c260 luacheckrc: Set max line length to 150 for now [luacheck]
Kim Alvefur <zash@zash.se>
parents: 7875
diff changeset
     7
8570
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
     8
read_globals = {
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
     9
	"prosody",
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
    10
	"import",
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
    11
};
8677
55807a2f5d23 luacheckrc: Only allow top level declarations in the main prosody executable
Kim Alvefur <zash@zash.se>
parents: 8585
diff changeset
    12
files["prosody"] = {
55807a2f5d23 luacheckrc: Only allow top level declarations in the main prosody executable
Kim Alvefur <zash@zash.se>
parents: 8585
diff changeset
    13
	allow_defined_top = true;
55807a2f5d23 luacheckrc: Only allow top level declarations in the main prosody executable
Kim Alvefur <zash@zash.se>
parents: 8585
diff changeset
    14
	module = true;
12300
49ebac8a5260 prosody: Expose main thread on the 'prosody' global
Kim Alvefur <zash@zash.se>
parents: 12006
diff changeset
    15
	globals = {
49ebac8a5260 prosody: Expose main thread on the 'prosody' global
Kim Alvefur <zash@zash.se>
parents: 12006
diff changeset
    16
		"prosody";
49ebac8a5260 prosody: Expose main thread on the 'prosody' global
Kim Alvefur <zash@zash.se>
parents: 12006
diff changeset
    17
	}
8677
55807a2f5d23 luacheckrc: Only allow top level declarations in the main prosody executable
Kim Alvefur <zash@zash.se>
parents: 8585
diff changeset
    18
}
8681
b86f789ac9bd luacheckrc: Allow top level variables in prosodyctl (eg CFG_*) [luacheck]
Kim Alvefur <zash@zash.se>
parents: 8680
diff changeset
    19
files["prosodyctl"] = {
b86f789ac9bd luacheckrc: Allow top level variables in prosodyctl (eg CFG_*) [luacheck]
Kim Alvefur <zash@zash.se>
parents: 8680
diff changeset
    20
	allow_defined_top = true;
b86f789ac9bd luacheckrc: Allow top level variables in prosodyctl (eg CFG_*) [luacheck]
Kim Alvefur <zash@zash.se>
parents: 8680
diff changeset
    21
	module = true;
b86f789ac9bd luacheckrc: Allow top level variables in prosodyctl (eg CFG_*) [luacheck]
Kim Alvefur <zash@zash.se>
parents: 8680
diff changeset
    22
};
7875
3105d35cc2c2 luacheckrc: Allow mutating the global prosody and hosts tables in core/ (luacheck 0.18 adds detection of indirect mutation)
Kim Alvefur <zash@zash.se>
parents: 7482
diff changeset
    23
files["core/"] = {
8570
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
    24
	globals = {
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
    25
		"prosody.hosts.?",
93695bb1f0e7 luacheckrc: Reflow globals settings
Kim Alvefur <zash@zash.se>
parents: 8560
diff changeset
    26
	};
7875
3105d35cc2c2 luacheckrc: Allow mutating the global prosody and hosts tables in core/ (luacheck 0.18 adds detection of indirect mutation)
Kim Alvefur <zash@zash.se>
parents: 7482
diff changeset
    27
}
8384
7f6184474149 luacheckrc: Ignore long commets (e.g. license in util.sasl)
Kim Alvefur <zash@zash.se>
parents: 8242
diff changeset
    28
files["util/"] = {
7f6184474149 luacheckrc: Ignore long commets (e.g. license in util.sasl)
Kim Alvefur <zash@zash.se>
parents: 8242
diff changeset
    29
	-- Ignore unwrapped license text
7f6184474149 luacheckrc: Ignore long commets (e.g. license in util.sasl)
Kim Alvefur <zash@zash.se>
parents: 8242
diff changeset
    30
	max_comment_line_length = false;
7f6184474149 luacheckrc: Ignore long commets (e.g. license in util.sasl)
Kim Alvefur <zash@zash.se>
parents: 8242
diff changeset
    31
}
11438
66d4067bdfb2 util.jsonschema: Library for JSON Schema validation
Kim Alvefur <zash@zash.se>
parents: 11001
diff changeset
    32
files["util/jsonschema.lua"] = {
66d4067bdfb2 util.jsonschema: Library for JSON Schema validation
Kim Alvefur <zash@zash.se>
parents: 11001
diff changeset
    33
	ignore = { "211" };
66d4067bdfb2 util.jsonschema: Library for JSON Schema validation
Kim Alvefur <zash@zash.se>
parents: 11001
diff changeset
    34
}
11439
a1fa6202fa13 util.datamapper: Library for extracting data from stanzas
Kim Alvefur <zash@zash.se>
parents: 11438
diff changeset
    35
files["util/datamapper.lua"] = {
a1fa6202fa13 util.datamapper: Library for extracting data from stanzas
Kim Alvefur <zash@zash.se>
parents: 11438
diff changeset
    36
	ignore = { "211" };
a1fa6202fa13 util.datamapper: Library for extracting data from stanzas
Kim Alvefur <zash@zash.se>
parents: 11438
diff changeset
    37
}
6753
2a2eb30b1ed4 luacheckrc: Allow plugins to implement functions under module.* (module.load, etc.)
Matthew Wild <mwild1@gmail.com>
parents: 6670
diff changeset
    38
files["plugins/"] = {
8576
85e51205eef7 luacheckrc: Restore module semantics, but only for plugins (ignores some globals)
Kim Alvefur <zash@zash.se>
parents: 8572
diff changeset
    39
	module = true;
8677
55807a2f5d23 luacheckrc: Only allow top level declarations in the main prosody executable
Kim Alvefur <zash@zash.se>
parents: 8585
diff changeset
    40
	allow_defined_top = true;
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    41
	read_globals = {
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    42
		-- Module instance
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    43
		"module.name",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    44
		"module.host",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    45
		"module._log",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    46
		"module.event_handlers",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    47
		"module.reloading",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    48
		"module.saved_state",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    49
		"module.global",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    50
		"module.path",
12302
cb459f8fa740 mod_c2s,mod_s2s: Disable and close port listeners before closing sessions
Kim Alvefur <zash@zash.se>
parents: 12300
diff changeset
    51
		"module.items",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    52
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    53
		-- Module API
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    54
		"module.add_extension",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    55
		"module.add_feature",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    56
		"module.add_identity",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    57
		"module.add_item",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    58
		"module.add_timer",
12006
cbed7d8d8f35 mod_cron: Add a 'weekly' job frequency
Kim Alvefur <zash@zash.se>
parents: 11991
diff changeset
    59
		"module.weekly",
11991
4b519c575ad0 core.moduleapi: Add API for adding daily or hourly tasks via mod_cron
Kim Alvefur <zash@zash.se>
parents: 11527
diff changeset
    60
		"module.daily",
4b519c575ad0 core.moduleapi: Add API for adding daily or hourly tasks via mod_cron
Kim Alvefur <zash@zash.se>
parents: 11527
diff changeset
    61
		"module.hourly",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    62
		"module.broadcast",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    63
		"module.context",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    64
		"module.depends",
12646
9061f9621330 Switch to a new role-based authorization framework, removing is_admin()
Matthew Wild <mwild1@gmail.com>
parents: 12591
diff changeset
    65
		"module.default_permission",
9061f9621330 Switch to a new role-based authorization framework, removing is_admin()
Matthew Wild <mwild1@gmail.com>
parents: 12591
diff changeset
    66
		"module.default_permissions",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    67
		"module.fire_event",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    68
		"module.get_directory",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    69
		"module.get_host",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    70
		"module.get_host_items",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    71
		"module.get_host_type",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    72
		"module.get_name",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    73
		"module.get_option",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    74
		"module.get_option_array",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    75
		"module.get_option_boolean",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    76
		"module.get_option_inherited_set",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    77
		"module.get_option_number",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    78
		"module.get_option_path",
7984
bbb900cfcfa5 luacheckrc: Add module:get_option_scalar to known globals
Kim Alvefur <zash@zash.se>
parents: 7956
diff changeset
    79
		"module.get_option_scalar",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    80
		"module.get_option_set",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    81
		"module.get_option_string",
9873
7be5477c399e .luacheckrc: Update to reflect new module API methods
Matthew Wild <mwild1@gmail.com>
parents: 9748
diff changeset
    82
		"module.get_status",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    83
		"module.handle_items",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    84
		"module.hook",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    85
		"module.hook_global",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    86
		"module.hook_object_event",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    87
		"module.hook_tag",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    88
		"module.load_resource",
9873
7be5477c399e .luacheckrc: Update to reflect new module API methods
Matthew Wild <mwild1@gmail.com>
parents: 9748
diff changeset
    89
		"module.log",
7be5477c399e .luacheckrc: Update to reflect new module API methods
Matthew Wild <mwild1@gmail.com>
parents: 9748
diff changeset
    90
		"module.log_status",
12646
9061f9621330 Switch to a new role-based authorization framework, removing is_admin()
Matthew Wild <mwild1@gmail.com>
parents: 12591
diff changeset
    91
		"module.may",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    92
		"module.measure",
11527
5f15ab7c6ae5 Statistics: Rewrite statistics backends to use OpenMetrics
Jonas Schäfer <jonas@wielicki.name>
parents: 11439
diff changeset
    93
		"module.metric",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    94
		"module.open_store",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    95
		"module.provides",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    96
		"module.remove_item",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    97
		"module.require",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
    98
		"module.send",
9748
8132030ff04a luacheckrc: Teach luacheck about the new module:send_iq() API
Kim Alvefur <zash@zash.se>
parents: 9735
diff changeset
    99
		"module.send_iq",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   100
		"module.set_global",
9873
7be5477c399e .luacheckrc: Update to reflect new module API methods
Matthew Wild <mwild1@gmail.com>
parents: 9748
diff changeset
   101
		"module.set_status",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   102
		"module.shared",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   103
		"module.unhook",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   104
		"module.unhook_object_event",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   105
		"module.wrap_event",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   106
		"module.wrap_global",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   107
		"module.wrap_object_event",
8572
f88bd2428bc2 .luacheckrc: Add awareness of the module:http_url API added by mod_http
Kim Alvefur <zash@zash.se>
parents: 8571
diff changeset
   108
f88bd2428bc2 .luacheckrc: Add awareness of the module:http_url API added by mod_http
Kim Alvefur <zash@zash.se>
parents: 8571
diff changeset
   109
		-- mod_http API
f88bd2428bc2 .luacheckrc: Add awareness of the module:http_url API added by mod_http
Kim Alvefur <zash@zash.se>
parents: 8571
diff changeset
   110
		"module.http_url",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   111
	};
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   112
	globals = {
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   113
		-- Methods that can be set on module API
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   114
		"module.unload",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   115
		"module.add_host",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   116
		"module.load",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   117
		"module.add_host",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   118
		"module.save",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   119
		"module.restore",
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   120
		"module.command",
8051
75e37366a03f luacheckrc: Declare module.environment as writable (thanks Link Mauve)
Kim Alvefur <zash@zash.se>
parents: 7984
diff changeset
   121
		"module.environment",
7955
38053bf1630d luacheckrc: Include entire module API
Kim Alvefur <zash@zash.se>
parents: 7952
diff changeset
   122
	};
6753
2a2eb30b1ed4 luacheckrc: Allow plugins to implement functions under module.* (module.load, etc.)
Matthew Wild <mwild1@gmail.com>
parents: 6670
diff changeset
   123
}
8242
20e3d5689cce .luacheckrc: Add busted globals for spec/* (thanks av6!)
Matthew Wild <mwild1@gmail.com>
parents: 8051
diff changeset
   124
files["spec/"] = {
9393
b749cce57f08 .luacheckrc: Allow randomize() global in spec/
Matthew Wild <mwild1@gmail.com>
parents: 9329
diff changeset
   125
	std = "+busted";
b749cce57f08 .luacheckrc: Allow randomize() global in spec/
Matthew Wild <mwild1@gmail.com>
parents: 9329
diff changeset
   126
	globals = { "randomize" };
7479
42d8955be784 luacheckrc: Ignore assert helper functions used in tests/*
Kim Alvefur <zash@zash.se>
parents: 6989
diff changeset
   127
}
8560
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   128
files["prosody.cfg.lua"] = {
8585
6a2366759974 luacheckrc: Ignore all unknown globals in config file (ie all settings)
Kim Alvefur <zash@zash.se>
parents: 8576
diff changeset
   129
	ignore = { "131" };
8802
7324a2fe755a .luacheckrc: Fix whitespace
Matthew Wild <mwild1@gmail.com>
parents: 8730
diff changeset
   130
	globals = {
8560
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   131
		"Host",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   132
		"host",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   133
		"VirtualHost",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   134
		"Component",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   135
		"component",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   136
		"Include",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   137
		"include",
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   138
		"RunScript"
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   139
	};
28f9b8a5d9cb luacheckrc: Declare known global functions in config file
Kim Alvefur <zash@zash.se>
parents: 8536
diff changeset
   140
}
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   141
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   142
if os.getenv("PROSODY_STRICT_LINT") ~= "1" then
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   143
	-- These files have not yet been brought up to standard
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   144
	-- Do not add more files here, but do help us fix these!
9446
4e881be88727 .luacheckrc: Ignore unused secondaries in non-strict mode
Kim Alvefur <zash@zash.se>
parents: 9445
diff changeset
   145
8824
c1014eac2a1a .luacheckrc: Only ignore warnings for excluded files, not syntax errors
Kim Alvefur <zash@zash.se>
parents: 8809
diff changeset
   146
	local exclude_files = {
9944
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   147
		"doc/net.server.lua";
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   148
9944
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   149
		"fallbacks/bit.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   150
		"fallbacks/lxp.lua";
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   151
9944
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   152
		"net/dns.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   153
		"net/server_select.lua";
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   154
9944
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   155
		"plugins/mod_storage_sql1.lua";
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   156
9944
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   157
		"spec/core_moduleapi_spec.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   158
		"spec/util_http_spec.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   159
		"spec/util_ip_spec.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   160
		"spec/util_multitable_spec.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   161
		"spec/util_rfc6724_spec.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   162
		"spec/util_throttle_spec.lua";
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   163
9944
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   164
		"tools/ejabberd2prosody.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   165
		"tools/ejabberdsql2prosody.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   166
		"tools/erlparse.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   167
		"tools/jabberd14sql2prosody.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   168
		"tools/migration/migrator.cfg.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   169
		"tools/migration/migrator/jabberd14.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   170
		"tools/migration/migrator/mtools.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   171
		"tools/migration/migrator/prosody_files.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   172
		"tools/migration/migrator/prosody_sql.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   173
		"tools/migration/prosody-migrator.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   174
		"tools/openfire2prosody.lua";
5d5e3d982bdc .luacheckrc: Correct indentation of 'exclude_files' list
Kim Alvefur <zash@zash.se>
parents: 9873
diff changeset
   175
		"tools/xep227toprosody.lua";
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   176
	}
8824
c1014eac2a1a .luacheckrc: Only ignore warnings for excluded files, not syntax errors
Kim Alvefur <zash@zash.se>
parents: 8809
diff changeset
   177
	for _, file in ipairs(exclude_files) do
c1014eac2a1a .luacheckrc: Only ignore warnings for excluded files, not syntax errors
Kim Alvefur <zash@zash.se>
parents: 8809
diff changeset
   178
		files[file] = { only = {} }
c1014eac2a1a .luacheckrc: Only ignore warnings for excluded files, not syntax errors
Kim Alvefur <zash@zash.se>
parents: 8809
diff changeset
   179
	end
8803
dd615a7a6b72 .luacheckrc: Ignore currently-unclean files unless env var PROSODY_STRICT_LINT=1
Matthew Wild <mwild1@gmail.com>
parents: 8802
diff changeset
   180
end