From 88591ff06ec861bff6b7b7a8cf63153c1d869592 Mon Sep 17 00:00:00 2001 From: Ali Sajid Imami <395482+AliSajid@users.noreply.github.com> Date: Sat, 19 Oct 2024 23:11:38 -0400 Subject: [PATCH] ci: add selene as a linter --- .pre-commit-config.yaml | 9 ++++++- selene.toml | 5 ++++ vim.toml | 59 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 selene.toml create mode 100644 vim.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8619e54..d6f9fe3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -123,4 +123,11 @@ repos: - repo: https://github.com/JohnnyMorganz/StyLua rev: v0.20.0 hooks: - - id: stylua # or stylua-system / stylua-github + - id: stylua + - repo: local + hooks: + - id: selene + name: Selene Lint + language: system + entry: selene + files: \.lua$ diff --git a/selene.toml b/selene.toml new file mode 100644 index 0000000..5d5795c --- /dev/null +++ b/selene.toml @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2024 Ali Sajid Imami +# +# SPDX-License-Identifier: CC0-1.0 + +std="vim" diff --git a/vim.toml b/vim.toml new file mode 100644 index 0000000..dbc1f4e --- /dev/null +++ b/vim.toml @@ -0,0 +1,59 @@ +# SPDX-FileCopyrightText: 2024 Ali Sajid Imami +# +# SPDX-License-Identifier: CC0-1.0 + +[selene] +base = "lua51" +name = "vim" + +[vim] +any = true + +[[describe.args]] +type = "string" +[[describe.args]] +type = "function" + +[[it.args]] +type = "string" +[[it.args]] +type = "function" + +[[before_each.args]] +type = "function" +[[after_each.args]] +type = "function" + +[assert.is_not] +any = true + +[assert.matches] +any = true + +[assert.has_error] +any = true + +[[assert.equals.args]] +type = "any" +[[assert.equals.args]] +type = "any" +[[assert.equals.args]] +type = "any" +required = false + +[[assert.same.args]] +type = "any" +[[assert.same.args]] +type = "any" + +[[assert.truthy.args]] +type = "any" + +[[assert.falsy.args]] +type = "any" + +[[assert.spy.args]] +type = "any" + +[[assert.stub.args]] +type = "any"