Skip to content

Curs3W4ll/NeoKit

Repository files navigation

CI

NeoKit

A standard module containing utility functions.
Make your code more explicit and meaningful.

Note that this library is a bit useless outside of Neovim since some functions require Neovim functions. It should be usable with any recent version of Neovim though.

At the moment, this plugin is under construction. Expect changes to the way it is structured.

Installation

Using Vim plug:

Plug 'Curs3W4ll/neokit'

Using Packer:

use "Curs3W4ll/neokit"

Using Lazy:

require("lazy").setup({
    "Curs3W4ll/NeoKit",
})

Usage

Use it like any Lua module

local neokit = require("neokit")

print(neokit.str.ensureLastChar("Hello", "!")) -- Hello!

-- OR

local str = require("neokit.str")

print(str.ensureLastChar("Hello", "!")) -- Hello!

Modules

You can find more details about modules at https://curs3w4ll.github.io/NeoKit/

Contributing

Help is welcome!
You are encouraged to submit new issues and pull requests to improve this plugin.

Please read the contribution guidelines first.

Useful commands

To ease interactions with the project, you can use the project's Makefile.
This Makefile defines a set of rules running commands for you.

You can execute make help to get more details about Makefile rules defined for the project.

With the Makefile, you can run tests, linter, formatter, and generate documentation...

Run unit tests

You can use make test to run the project's unit test.
Test files are located under the tests/ directory.

Note that this will run every test of the project.
If you want to run a specific test, you can run only one test file by defining the TEST_FILE argument.

make test TEST_FILE=arrray_spec.lua

Watchers

To ease the unit tests development and the use of TDD method,

Important

These watchers are available for UNIX users only.

There are currently two watchers, one to run the linter, and one to run unit tests.
These watchers will execute the command again each time the code is modified.

make watch-lint
make watch-test

Note

You can use the TEST_FILE argument with the watcher too

Automatic workflows

Some things are automatically done by the Github workflow made for the project.

Formatting

Each time new code is pushed on the main branch, the formatter will be launched automatically and the new version of the formatted code will be pushed.

Documentation generation

Each time new code is pushed on the main branch, the workflow will automatically generate a new version of the HTML documentation and publish it here.

Mandatory checks

Some checks (that are mandatory to merge a PR) are automatically done by workflow too.

Each time a new PR is created or updated, the workflow will automatically check if:

  • Unit tests are passing
  • Linter does not yell any warning