diff --git a/.editorconfig b/.editorconfig index 75a6f55..e209bb1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,8 @@ root = true -[*] +[*.*] end_of_line = lf charset = utf-8 indent_style = space indent_size = 2 trim_trailing_whitespace = true - -# Ignore -[LICENSE] -generated_code = true diff --git a/.envrc b/.envrc new file mode 100755 index 0000000..ae4dc27 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake -Lv diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 989bc78..0000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Lint Code Base -on: - pull_request: ~ - push: - branches: - - master - -jobs: - build: - name: Lint Code Base - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Lint Code Base - uses: github/super-linter/slim@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - LINTER_RULES_PATH: / - VALIDATE_JSCPD: false - VALIDATE_PYTHON_BLACK: false diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0ae7ab5..d80e452 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,11 +1,19 @@ --- -name: "Test Luarocks install" +name: "Tests and checks" on: pull_request jobs: - luarocks-release: + checks: runs-on: ubuntu-latest - name: Test Luarocks install + name: Checks + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v20 + - name: Nix checks + run: nix flake check -L + tests: + runs-on: ubuntu-latest + name: Tests steps: - name: Checkout uses: actions/checkout@v3 @@ -15,7 +23,7 @@ jobs: LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} with: dependencies: | - plenary.nvim + dkjson version: "0.0.0" upload: false copy_directories: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f0f741..d70aad4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,8 +18,7 @@ jobs: LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} with: dependencies: | - plenary.nvim - telescope.nvim + dkjson labels: | neovim summary: "Luarocks release workflow for GitHub" diff --git a/.hadolint.yaml b/.hadolint.yaml deleted file mode 100644 index 1d8c0f0..0000000 --- a/.hadolint.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -ignored: - - DL4006 diff --git a/flake.lock b/flake.lock index d6b1ff0..a06c9c5 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -87,7 +102,7 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -110,6 +125,7 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks" } diff --git a/flake.nix b/flake.nix index bff4f40..536ab57 100644 --- a/flake.nix +++ b/flake.nix @@ -8,22 +8,25 @@ url = "github:cachix/pre-commit-hooks.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, + flake-utils, pre-commit-hooks, ... }: let supportedSystems = [ "x86_64-linux" ]; - perSystem = nixpkgs.lib.genAttrs supportedSystems; - pkgsFor = system: import nixpkgs {inherit system;}; + in + flake-utils.lib.eachSystem supportedSystems (system: let + pkgs = import nixpkgs {inherit system;}; + inherit (pkgs) lib; - luarocks-tag-release-action-for = system: let - pkgs = pkgsFor system; luarocks-tag-release-wrapped = pkgs.lua51Packages.buildLuaApplication { pname = "luarocks-tag-release"; version = "scm-1"; @@ -35,8 +38,8 @@ luafilesystem ]; }; - in - pkgs.writeShellApplication { + + luarocks-tag-release-action = pkgs.writeShellApplication { name = "luarocks-tag-release-action"; runtimeInputs = with pkgs; [ curl @@ -54,12 +57,34 @@ # The default checkPhase depends on ShellCheck, which depends on GHC checkPhase = ""; }; - in { - packages = perSystem (system: let - luarocks-tag-release-action = luarocks-tag-release-action-for system; + + formatting = pre-commit-hooks.lib.${system}.run { + src = self; + hooks = { + alejandra.enable = true; + stylua.enable = true; + luacheck.enable = true; + editorconfig-checker.enable = true; + markdownlint.enable = true; + }; + settings = { + markdownlint.config = { + MD004 = false; + MD012 = false; + MD013 = false; + MD022 = false; + MD031 = false; + MD032 = false; + }; + }; + }; in { - default = luarocks-tag-release-action; - inherit luarocks-tag-release-action; + packages = { + default = luarocks-tag-release-action; + inherit luarocks-tag-release-action; + }; + checks = { + inherit formatting; + }; }); - }; }