Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/ci.yaml

This file was deleted.

84 changes: 7 additions & 77 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,83 +7,13 @@ on:
branches: [main]

jobs:
changes:
quality:
name: Quality
runs-on: ubuntu-latest
outputs:
lua: ${{ steps.changes.outputs.lua }}
markdown: ${{ steps.changes.outputs.markdown }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lua:
- 'lua/**'
- 'plugin/**'
- '*.lua'
- '.luarc.json'
- '*.toml'
markdown:
- '*.md'
- 'doc/**/*.md'

lua-format:
name: Lua Format Check
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: 2.1.0
args: --check .

lua-lint:
name: Lua Lint Check
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Lint with Selene
uses: NTBBloodbath/selene-action@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --display-style quiet .

lua-typecheck:
name: Lua Type Check
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Run Lua LS Type Check
uses: mrcjkb/lua-typecheck-action@v0
with:
checklevel: Warning
directories: lua
configpath: .luarc.json

markdown-format:
name: Markdown Format Check
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.markdown == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install prettier
run: pnpm add -g prettier@3.1.0
- name: Check markdown formatting with prettier
run: prettier --check .
- uses: cachix/install-nix-action@v31
- name: Format
run: nix develop .#ci --command just format
- name: Lint
run: nix develop .#ci --command just lint
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
description = "http-codes.nvim — HTTP status code reference for Neovim";

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
{
formatter = forEachSystem (pkgs: pkgs.nixfmt-tree);

devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.just
pkgs.prettier
pkgs.stylua
pkgs.neovim
pkgs.selene
pkgs.lua-language-server
pkgs.vimdoc-language-server
];
};

ci = pkgs.mkShell {
packages = [
pkgs.just
pkgs.prettier
pkgs.stylua
pkgs.neovim
pkgs.selene
pkgs.lua-language-server
pkgs.vimdoc-language-server
];
};
});
};
}
15 changes: 15 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
default:
@just --list

format:
nix fmt -- --ci
stylua --check .
prettier --check .

lint:
git ls-files '*.lua' | xargs selene --display-style quiet
lua-language-server --check . --configpath "$(pwd)/.luarc.json" --checklevel=Warning
vimdoc-language-server check doc/

ci: format lint
@:
Loading