Skip to content

Commit

Permalink
github/workflows: add lua linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 committed May 11, 2024
1 parent 552c455 commit ea6ea03
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ jobs:
- uses: actions/checkout@v4

- uses: norio-nomura/[email protected]

lua-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lunarmodules/luacheck@v1
60 changes: 60 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
stds = {
mp = {
globals = {
"mp",
"mp.command",
"mp.commandv",
"mp.command_native",
"mp.command_native_async",
"mp.abort_async_command",
"mp.del_property",
"mp.get_property",
"mp.get_property_osd",
"mp.get_property_bool",
"mp.get_property_number",
"mp.get_property_native",
"mp.set_property",
"mp.set_property_bool",
"mp.set_property_number",
"mp.set_property_native",
"mp.get_time",
"mp.add_key_binding",
"mp.add_forced_key_binding",
"mp.remove_key_binding",
"mp.register_event",
"mp.unregister_event",
"mp.observe_property",
"mp.unobserve_property",
"mp.add_timeout",
"mp.add_periodic_timer",
"mp.get_opt",
"mp.get_script_name",
"mp.get_script_directory",
"mp.osd_message",
"mp.get_wakeup_pipe",
"mp.get_next_timeout",
"mp.dispatch_events",
"mp.register_idle",
"mp.unregister_idle",
"mp.enable_messages",
"mp.register_script_message",
"mp.unregister_script_message",
"mp.create_osd_overlay",
"mp.get_osd_size",
"mp.msg.fatal",
"mp.msg.error",
"mp.msg.warn",
"mp.msg.info",
"mp.msg.verbose",
"mp.msg.debug",
"mp.msg.trace",
}
}
}

std = "+mp"

ignore = {
"111", -- setting non-standard global variable
"121", -- accessing undefined global variable
}

0 comments on commit ea6ea03

Please sign in to comment.