mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-17 17:24:21 +02:00
flake: move formatting and git hooks into dedicated modules
Some checks failed
Publish every Git push to main to FlakeHub / flakehub-publish (push) Has been cancelled
Publish every git push to Flakestry / publish-flake (push) Has been cancelled
Documentation / Version info (push) Has been cancelled
Documentation / Build (push) Has been cancelled
Documentation / Combine builds (push) Has been cancelled
Documentation / Deploy (push) Has been cancelled
Some checks failed
Publish every Git push to main to FlakeHub / flakehub-publish (push) Has been cancelled
Publish every git push to Flakestry / publish-flake (push) Has been cancelled
Documentation / Version info (push) Has been cancelled
Documentation / Build (push) Has been cancelled
Documentation / Combine builds (push) Has been cancelled
Documentation / Deploy (push) Has been cancelled
This commit is contained in:
parent
97819ce539
commit
1fb1bf8a73
3 changed files with 133 additions and 117 deletions
69
flake/dev/fmt.nix
Normal file
69
flake/dev/fmt.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
ci.buildbot = {
|
||||
inherit (config.checks) treefmt;
|
||||
};
|
||||
|
||||
treefmt.config = {
|
||||
projectRootFile = "flake.nix";
|
||||
flakeCheck = true;
|
||||
|
||||
programs = {
|
||||
# keep-sorted start block=yes newline_separated=no
|
||||
isort.enable = true;
|
||||
keep-sorted.enable = true;
|
||||
nixfmt = {
|
||||
enable = true;
|
||||
package = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
prettier = {
|
||||
enable = true;
|
||||
excludes = [ "**.md" ];
|
||||
};
|
||||
ruff = {
|
||||
check = true;
|
||||
format = true;
|
||||
};
|
||||
shfmt.enable = true;
|
||||
statix = {
|
||||
enable = true;
|
||||
disabled-lints = [
|
||||
# We often use `nullable == true`
|
||||
"bool_comparison"
|
||||
];
|
||||
};
|
||||
stylua.enable = true;
|
||||
# FIXME: re-enable on darwin, currently broken: taplo with options '[format]' failed to apply: exit status 101
|
||||
taplo.enable = pkgs.stdenv.isLinux;
|
||||
# keep-sorted end
|
||||
};
|
||||
|
||||
settings = {
|
||||
global.excludes = [
|
||||
".editorconfig"
|
||||
".envrc"
|
||||
".git-blame-ignore-revs"
|
||||
".gitignore"
|
||||
"LICENSE"
|
||||
"flake.lock"
|
||||
"**.md"
|
||||
"**.scm"
|
||||
"**.svg"
|
||||
"**/man/*.5"
|
||||
# Those files are generated by pytest-regression, which then `diff`s them.
|
||||
# Formatting them will make the tests fail.
|
||||
"docs/gfm-alerts-to-admonitions/tests/**/*.yml"
|
||||
];
|
||||
formatter.ruff-format.options = [ "--isolated" ];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue