generated from mrcjkb/nvim-lua-nix-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 19678fb
Showing
21 changed files
with
1,360 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
return { | ||
_all = { | ||
coverage = false, | ||
lpath = "lua/?.lua;lua/?/init.lua", | ||
}, | ||
default = { | ||
verbose = true | ||
}, | ||
tests = { | ||
verbose = true | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*.*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake . -Lv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: "Nix build" | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v20 | ||
- run: nix flake check -L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: "Luarocks release" | ||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
luarocks-release: | ||
runs-on: ubuntu-latest | ||
name: Release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Fail if changelog entry does not exist | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: grep -q "${{ github.ref_name }}" CHANGELOG.md | ||
- name: Luarocks Upload | ||
uses: nvim-neorocks/luarocks-tag-release@v5 | ||
env: | ||
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} | ||
- name: Fail if changelog entry does not exist | ||
run: grep -q "${{ github.ref_name }}" CHANGELOG.md | ||
- name: GitHub release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
bodyFile: "CHANGELOG.md" | ||
allowUpdates: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
result | ||
.pre-commit-config.yaml | ||
.direnv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ignore = { | ||
"631", -- max_line_length | ||
"122", -- read-only field of global variable | ||
} | ||
read_globals = { | ||
"vim", | ||
"describe", | ||
"it", | ||
"assert" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 2 | ||
quote_style = "AutoPreferSingle" | ||
call_parentheses = "NoSingleTable" | ||
collapse_simple_statement = "Never" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!-- markdownlint-disable --> | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [3.1.0] - 2023-09-05 | ||
|
||
### Added | ||
|
||
- Use `neorocksTest`. | ||
|
||
### Changed | ||
|
||
- Bump `luarocks-tag-release` version. | ||
|
||
### Fixed | ||
|
||
- Fail release if changelog entry doesn't exist. | ||
|
||
## [3.0.0] - 2023-08-16 | ||
|
||
### Fixed | ||
|
||
- Luarocks Upload workflow. | ||
|
||
### Changed | ||
|
||
- Loosen license restrictions to allow any OSI approved open source derivations. | ||
- Switch from `flake-utils` to `flake-parts`. | ||
|
||
### Added | ||
|
||
- More pre-commit-hooks and linters. | ||
- `luarocks-tag-release` workflow. | ||
- Add lua-ls pre-commit checks. | ||
|
||
### Changed | ||
|
||
- Remove `cachix-action` from workflow. | ||
|
||
## [2.0.0] - 2023-01-02 | ||
|
||
### Changed | ||
|
||
- Replace `nixpkgs-fmt` with `alejandra`. | ||
|
||
## [1.0.0] - 2022-10-20 | ||
|
||
### Added | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Contributing guide | ||
|
||
Contributions are more than welcome! | ||
|
||
Please don't forget to add your changes to the "Unreleased" section of | ||
[the changelog](./CHANGELOG.md) (if applicable). | ||
|
||
## Commit messages | ||
|
||
This project uses | ||
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). | ||
|
||
## Development | ||
|
||
I use [`nix`](https://nixos.org/download.html#download-nix) | ||
(with flakes enabled) for development and testing. | ||
|
||
Formatting is done with [`stylua`](https://github.com/JohnnyMorganz/StyLua). | ||
|
||
To enter a development shell: | ||
|
||
```console | ||
nix develop | ||
``` | ||
|
||
To apply formatting, while in a devShell, run | ||
|
||
```console | ||
pre-commit run --all | ||
``` | ||
|
||
If you use [`direnv`](https://direnv.net/), | ||
just run `direnv allow` and you will be dropped in this devShell. | ||
|
||
## Tests | ||
|
||
### Running tests | ||
|
||
I use [`busted`](https://lunarmodules.github.io/busted/) for testing, | ||
but with Neovim as the Lua interpreter. | ||
|
||
The easiest way to run tests is with Nix (see below). | ||
|
||
If you do not use Nix, you can also run the test suite using `luarocks test`. | ||
For more information on how to set up Neovim as a Lua interpreter, see | ||
|
||
- The [neorocks tutorial](https://github.com/nvim-neorocks/neorocks#without-neolua). | ||
|
||
Or | ||
|
||
- [`nlua`](https://github.com/mfussenegger/nlua). | ||
|
||
> [!NOTE] | ||
> | ||
> The Nix devShell sets up `luarocks test` to use Neovim as the interpreter. | ||
### Running tests and checks with Nix | ||
|
||
If you just want to run all checks that are available, | ||
run: | ||
|
||
```console | ||
nix flake check --print-build-logs | ||
``` | ||
|
||
To run tests locally | ||
|
||
```console | ||
nix build .#checks.<your-system>.ci --print-build-logs | ||
``` | ||
|
||
For formatting: | ||
|
||
```console | ||
nix build .#checks.<your-system>.formatting --print-build-logs | ||
``` |
Oops, something went wrong.