Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add nix flake for linting + devShell + workflow #1

Merged
merged 9 commits into from
Oct 8, 2023

Conversation

mrcjkb
Copy link
Member

@mrcjkb mrcjkb commented Sep 1, 2023

I noticed there's a stylua run in the makefile, but there's no .stylua.toml.

  • That should probably be added before this gets merged.

This adds a Nix flake with:

  • A devShell with things like lua-language-server, luacheck, stylua, ...
  • checks that run the linters (I also included editorconfig-checker, but I'm not sure if we want that?).
  • A GitHub workflow that runs the checks on push and PR.

If we decide to merge this, I would like to follow-up with a check that runs busted tests using neorocksTest.

@mrcjkb
Copy link
Member Author

mrcjkb commented Sep 1, 2023

Note: When run locally, the stylua check fails.

@mrcjkb
Copy link
Member Author

mrcjkb commented Sep 1, 2023

Oh wait - there is a stylua.toml (not hidden) 🤔 I wonder why it's failing...

Update: I think it's nio. I've added a .styluaignore, but it seems like stylua doesn't pick up on it if you pass in the file name, which is what the pre-commit-hooks-nix check does.

See also: JohnnyMorganz/StyLua#751

@vhyrro
Copy link
Collaborator

vhyrro commented Sep 1, 2023

It's likely because you're not compiling stylua with 5.2 support, which is required for parsing of goto and some other stuff. With cargo it's as simple as cargo install stylua --features lua52 but unsure how it works in nix.

@vhyrro
Copy link
Collaborator

vhyrro commented Sep 1, 2023

Also a stylua.toml is also considered standard and it picks it up on my end with no problems 🤔

@mrcjkb
Copy link
Member Author

mrcjkb commented Sep 2, 2023

Let's see if the fix gets merged on the Nix side: cachix/git-hooks.nix#346
The stylua behaviour is intended.

nix/plugin-overlay.nix Outdated Show resolved Hide resolved
@mrcjkb mrcjkb merged commit c70cc5e into nvim-neorocks:master Oct 8, 2023
@mrcjkb mrcjkb deleted the mrjckb/flake branch October 8, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants