diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7b4eaf9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI +on: + push: + pull_request: + branches: + - main + +jobs: + stylua: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run Stylua + uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --color always --check . + + selene: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Selene + run: cargo install selene + + - name: Run Selene + run: selene --display-style quiet --config ./.selene.toml lua + + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install codespell + run: pip install codespell + + - name: Use codespell + run: make spell + + generate-doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: panvimdoc + uses: kdheepak/panvimdoc@main + with: + vimdoc: telescope-resession + version: "Neovim >= 0.9.0" + titledatepattern: "%Y" + demojify: true + treesitter: true + + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "docs: auto-generate vimdoc" + + release: + runs-on: ubuntu-latest + needs: [stylua, selene, codespell, generate-doc] + if: github.ref == 'refs/heads/main' + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: simple diff --git a/.neovim.std.yml b/.neovim.std.yml new file mode 100644 index 0000000..4e702f9 --- /dev/null +++ b/.neovim.std.yml @@ -0,0 +1,27 @@ +--- +base: lua51 + +globals: + jit: + any: true + vim: + any: true + assert: + args: + - type: bool + - type: string + required: false + after_each: + args: + - type: function + before_each: + args: + - type: function + describe: + args: + - type: string + - type: function + it: + args: + - type: string + - type: function diff --git a/.selene.toml b/.selene.toml new file mode 100644 index 0000000..a96a3a6 --- /dev/null +++ b/.selene.toml @@ -0,0 +1,9 @@ +std = ".neovim.std" + +[rules] +global_usage = "warn" +multiple_statements = "allow" +incorrect_standard_library_use = "allow" +mixed_table = "allow" +unused_variable = "warn" +unescoped_variables = "warn" diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..60fd23f --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,4 @@ +column_width = 120 +indent_type = "Spaces" +indent_width = 4 +quote_style = "AutoPreferDouble" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cd6dea3 --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +ifeq ($(OS),Windows_NT) + GREEN= + RESTORE= +else + GREEN="\033[0;32m" + RESTORE="\033[0m" +endif + +# make the output of the message appear green +define style_calls + $(eval $@_msg = $(1)) + echo ${GREEN}${$@_msg}${RESTORE} +endef + +lint: style-lint + @$(call style_calls,"Running selene") + @selene --display-style quiet --config ./.selene.toml lua + @$(call style_calls,"Done!") + +.PHONY: lint + +style-lint: + @$(call style_calls,"Running stylua check") + @stylua --color always -f ./.stylua.toml --check lua + @$(call style_calls,"Done!") + +.PHONY: style-lint + +format: + @$(call style_calls,"Running stylua format") + @stylua --color always -f ./.stylua.toml lua + @$(call style_calls,"Done!") + +.PHONY: format + +spell: + @$(call style_calls,"Running codespell check") + @codespell --quiet-level=2 --check-hidden --skip=./.git,./CHANGELOG.md + @$(call style_calls,"Done!") + +.PHONY: spell + +spell-write: + @$(call style_calls,"Running codespell write") + @codespell --quiet-level=2 --check-hidden --skip=./.git,./CHANGELOG.md --write-changes + @$(call style_calls,"Done!") + +.PHONY: spell-write diff --git a/doc/telescope-resession.txt b/doc/telescope-resession.txt new file mode 100644 index 0000000..e69de29