From d393deec8be4e8a2bfb92001bd4296bc058a1f26 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 21 Feb 2026 23:20:26 -0500 Subject: [PATCH 1/3] build: add luarocks packaging and bump stylua Problem: oil.nvim had no luarocks rockspec, so users of rocks.nvim and similar tools could not install it from the registry. The stylua CI action was also pinned to an older version. Solution: add scm-1 rockspec and a luarocks publish workflow that gates on tests passing before publishing on version tags. Bump stylua action from v2.0.2 to v2.1.0. Closes: barrettruth/oil.nvim#14 --- .github/workflows/luarocks.yml | 21 +++++++++++++++++++++ .github/workflows/tests.yml | 2 +- oil.nvim-scm-1.rockspec | 21 +++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/luarocks.yml create mode 100644 oil.nvim-scm-1.rockspec diff --git a/.github/workflows/luarocks.yml b/.github/workflows/luarocks.yml new file mode 100644 index 0000000..999f728 --- /dev/null +++ b/.github/workflows/luarocks.yml @@ -0,0 +1,21 @@ +name: luarocks + +on: + push: + tags: + - 'v*' + +jobs: + tests: + uses: ./.github/workflows/tests.yml + + publish: + needs: tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: nvim-neorocks/luarocks-tag-release@v7 + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 462bb8f..4ef3bb1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: uses: JohnnyMorganz/stylua-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - version: v2.0.2 + version: v2.1.0 args: --check lua tests typecheck: diff --git a/oil.nvim-scm-1.rockspec b/oil.nvim-scm-1.rockspec new file mode 100644 index 0000000..e58c602 --- /dev/null +++ b/oil.nvim-scm-1.rockspec @@ -0,0 +1,21 @@ +rockspec_format = '3.0' +package = 'oil.nvim' +version = 'scm-1' + +source = { + url = 'git+https://github.com/barrettruth/oil.nvim.git', +} + +description = { + summary = 'Neovim file explorer: edit your filesystem like a buffer', + homepage = 'https://github.com/barrettruth/oil.nvim', + license = 'MIT', +} + +dependencies = { + 'lua >= 5.1', +} + +build = { + type = 'builtin', +} From 364b78757815ab263980222bfd61412c3224a5b8 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 21 Feb 2026 23:25:42 -0500 Subject: [PATCH 2/3] build: replace luacheck with selene Problem: luacheck is unmaintained (last release 2018) and required suppressing four warning classes to avoid false positives. It also lacks first-class vim/neovim awareness. Solution: switch to selene with std='vim' for vim-aware linting. Replace the luacheck CI job with selene, update the Makefile lint target, and delete .luacheckrc. --- .github/workflows/tests.yml | 17 +++++------------ .luacheckrc | 19 ------------------- Makefile | 2 +- selene.toml | 1 + 4 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 .luacheckrc create mode 100644 selene.toml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 462bb8f..8b1cc58 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,21 +10,14 @@ on: - main jobs: - luacheck: - name: Luacheck + selene: + name: Selene runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - - name: Prepare - run: | - sudo apt-get update - sudo add-apt-repository universe - sudo apt install luarocks -y - sudo luarocks install luacheck - - - name: Run Luacheck - run: luacheck lua tests + - uses: NTBBloodbath/selene-action@v1.0.0 + with: + args: --display-style quiet . stylua: name: StyLua diff --git a/.luacheckrc b/.luacheckrc deleted file mode 100644 index 7efefde..0000000 --- a/.luacheckrc +++ /dev/null @@ -1,19 +0,0 @@ -max_comment_line_length = false -codes = true - -exclude_files = { - "tests/treesitter", -} - -ignore = { - "212", -- Unused argument - "631", -- Line is too long - "122", -- Setting a readonly global - "542", -- Empty if branch -} - -read_globals = { - "vim", - "a", - "assert", -} diff --git a/Makefile b/Makefile index 897b281..966374d 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ test: .PHONY: lint lint: scripts/nvim-typecheck-action ./scripts/nvim-typecheck-action/typecheck.sh --workdir scripts/nvim-typecheck-action lua - luacheck lua tests --formatter plain + selene --display-style quiet . stylua --check lua tests ## profile: use LuaJIT profiler to profile the plugin diff --git a/selene.toml b/selene.toml new file mode 100644 index 0000000..96cf5ab --- /dev/null +++ b/selene.toml @@ -0,0 +1 @@ +std = 'vim' From 50f1ade92c321b309d39954b59ca123498e46712 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 21 Feb 2026 23:26:39 -0500 Subject: [PATCH 3/3] build: add nix devshell and pre-commit hooks Problem: oil.nvim had no reproducible dev environment. The .envrc set up a Python venv for the now-removed docgen pipeline, and there were no pre-commit hooks for local formatting checks. Solution: add flake.nix with stylua, selene, and prettier in the devshell. Replace the stale Python .envrc with 'use flake'. Add .pre-commit-config.yaml with stylua and prettier hooks matching other plugins in the repo collection. --- .envrc | 4 +--- .pre-commit-config.yaml | 17 ++++++++++++++++ Makefile | 2 +- flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 29 +++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc index d522e34..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1 @@ -export VIRTUAL_ENV=venv -layout python -python -c 'import pyparsing' 2>/dev/null || pip install -r scripts/requirements.txt +use flake diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5d1f13f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +minimum_pre_commit_version: '3.5.0' + +repos: + - repo: https://github.com/JohnnyMorganz/StyLua + rev: v2.3.1 + hooks: + - id: stylua-github + name: stylua (Lua formatter) + files: \.lua$ + pass_filenames: true + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + name: prettier + files: \.(md|toml|yaml|yml|sh)$ diff --git a/Makefile b/Makefile index 966374d..db15dd5 100644 --- a/Makefile +++ b/Makefile @@ -45,4 +45,4 @@ scripts/benchmark.nvim: ## clean: reset the repository to a clean state .PHONY: clean clean: - rm -rf scripts/nvim-typecheck-action venv .testenv perf/tmp profile.json + rm -rf scripts/nvim-typecheck-action .testenv perf/tmp profile.json diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7501bfa --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1771207753, + "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d1c15b7d5806069da59e819999d70e1cec0760bf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5670f55 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "oil.nvim — Neovim file explorer: edit your filesystem like a buffer"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + systems.url = "github:nix-systems/default"; + }; + + outputs = + { + nixpkgs, + systems, + ... + }: + let + forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); + in + { + devShells = forEachSystem (pkgs: { + default = pkgs.mkShell { + packages = [ + pkgs.prettier + pkgs.stylua + pkgs.selene + ]; + }; + }); + }; +}