1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

flake: add nixf-diagnose to treefmt config

Checks nixd's diagnostic lints using libnixf.
This commit is contained in:
Matt Sturgeon 2025-09-29 02:10:08 +01:00
parent 74423f4a53
commit fe059cd395
38 changed files with 53 additions and 171 deletions

View file

@ -8,7 +8,6 @@
{ {
pkgs, pkgs,
config, config,
self',
system, system,
... ...
}: }:

View file

@ -5,7 +5,7 @@
]; ];
perSystem = perSystem =
{ config, pkgs, ... }: { pkgs, ... }:
{ {
treefmt.config = { treefmt.config = {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
@ -15,6 +15,10 @@
# keep-sorted start block=yes newline_separated=no # keep-sorted start block=yes newline_separated=no
isort.enable = true; isort.enable = true;
keep-sorted.enable = true; keep-sorted.enable = true;
nixf-diagnose = {
enable = true;
priority = -1;
};
nixfmt = { nixfmt = {
enable = true; enable = true;
package = pkgs.nixfmt-rfc-style; package = pkgs.nixfmt-rfc-style;
@ -30,6 +34,7 @@
shfmt.enable = true; shfmt.enable = true;
statix = { statix = {
enable = true; enable = true;
priority = -2;
disabled-lints = [ disabled-lints = [
# We often use `nullable == true` # We often use `nullable == true`
"bool_comparison" "bool_comparison"
@ -58,6 +63,14 @@
"docs/gfm-alerts-to-admonitions/tests/**/*.yml" "docs/gfm-alerts-to-admonitions/tests/**/*.yml"
]; ];
formatter.ruff-format.options = [ "--isolated" ]; formatter.ruff-format.options = [ "--isolated" ];
formatter.nixf-diagnose.options = [
"--auto-fix"
"--ignore=sema-unused-def-lambda-witharg-formal"
];
formatter.nixf-diagnose.excludes = [
# sema-unused-def-lambda-noarg-formal
"ci/rust-analyzer/default.nix"
];
}; };
}; };

View file

@ -2,12 +2,7 @@
{ {
imports = [ inputs.flake-parts.flakeModules.easyOverlay ]; imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
perSystem = perSystem =
{ { config, ... }:
config,
pkgs,
final,
...
}:
{ {
overlayAttrs = { overlayAttrs = {
nixvim = { nixvim = {

View file

@ -5,7 +5,7 @@
}: }:
{ {
perSystem = perSystem =
{ system, pkgs, ... }: { system, ... }:
{ {
_module.args = { _module.args = {
makeNixvimWithModule = import ../wrappers/standalone.nix { makeNixvimWithModule = import ../wrappers/standalone.nix {

View file

@ -1,9 +1,4 @@
{ { lib, config, ... }:
lib,
helpers,
config,
...
}:
{ {
options = { options = {
highlight = lib.mkOption { highlight = lib.mkOption {

View file

@ -1,9 +1,4 @@
{ { config, lib, ... }:
config,
lib,
options,
...
}:
with lib; with lib;
let let
inherit (lib.nixvim) inherit (lib.nixvim)

View file

@ -1,9 +1,4 @@
{ { lib, config, ... }:
lib,
options,
config,
...
}:
let let
inherit (lib) types; inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules; inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules;

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "commentary"; name = "commentary";
package = "vim-commentary"; package = "vim-commentary";

View file

@ -1,9 +1,4 @@
{ { config, lib, ... }:
config,
lib,
pkgs,
...
}:
let let
inherit (lib) types; inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;

View file

@ -1,6 +1,5 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...

View file

@ -3,7 +3,6 @@
helpers, helpers,
config, config,
pkgs, pkgs,
options,
... ...
}: }:
with lib; with lib;

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "endwise"; name = "endwise";
package = "vim-endwise"; package = "vim-endwise";

View file

@ -1,9 +1,4 @@
{ { lib, config, ... }:
lib,
config,
options,
...
}:
let let
inherit (lib) types; inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;

View file

@ -1,16 +1,10 @@
{ { lib, config, ... }:
lib,
helpers,
config,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "headlines"; name = "headlines";
package = "headlines-nvim"; package = "headlines-nvim";
description = "A plugin that adds horizontal highlights for text filetypes, like markdown, orgmode, and neorg."; description = "A plugin that adds horizontal highlights for text filetypes, like markdown, orgmode, and neorg.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsExample = { settingsExample = {
org.headline_highlights = false; org.headline_highlights = false;

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "helm"; name = "helm";
package = "vim-helm"; package = "vim-helm";

View file

@ -1,9 +1,4 @@
{ { lib, ... }:
lib,
helpers,
config,
...
}:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "hunk"; name = "hunk";
package = "hunk-nvim"; package = "hunk-nvim";

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
helpers,
lib,
...
}:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "idris2"; name = "idris2";
package = "idris2-nvim"; package = "idris2-nvim";

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
with lib; with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "lsp-lines"; name = "lsp-lines";

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
pkgs,
...
}:
let let
inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules; inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules;
inherit (lib) types; inherit (lib) types;

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "nix"; name = "nix";
package = "vim-nix"; package = "vim-nix";

View file

@ -1,9 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "preview"; name = "preview";
package = "Preview-nvim"; package = "Preview-nvim";
@ -11,5 +6,5 @@ lib.nixvim.plugins.mkNeovimPlugin {
hasSettings = false; hasSettings = false;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
} }

View file

@ -1,9 +1,4 @@
{ { config, lib, ... }:
config,
lib,
pkgs,
...
}:
let let
inherit (lib) mkRemovedOptionModule types; inherit (lib) mkRemovedOptionModule types;
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;

View file

@ -2,7 +2,6 @@
lib, lib,
helpers, helpers,
config, config,
pkgs,
... ...
}: }:
with lib; with lib;
@ -26,7 +25,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
}) })
]; ];
settingsOptions = import ./settings-options.nix { inherit lib helpers pkgs; }; settingsOptions = import ./settings-options.nix { inherit lib helpers; };
settingsExample = { settingsExample = {
server = { server = {

View file

@ -1,8 +1,4 @@
{ { lib, helpers }:
lib,
helpers,
pkgs,
}:
with lib; with lib;
{ {
tools = tools =

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "smart-splits"; name = "smart-splits";
package = "smart-splits-nvim"; package = "smart-splits-nvim";

View file

@ -1,9 +1,4 @@
{ { lib, ... }:
config,
lib,
pkgs,
...
}:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "timerly"; name = "timerly";
package = "timerly"; package = "timerly";

View file

@ -1,6 +1,5 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...

View file

@ -1,11 +1,6 @@
{ { lib, ... }:
lib,
helpers,
...
}:
with lib; with lib;
with lib.nixvim.plugins; lib.nixvim.plugins.mkVimPlugin {
mkVimPlugin {
name = "undotree"; name = "undotree";
globalPrefix = "undotree_"; globalPrefix = "undotree_";
description = "The undo history visualizer for Vim."; description = "The undo history visualizer for Vim.";

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }: { lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "vim-be-good"; name = "vim-be-good";
package = "vim-be-good"; package = "vim-be-good";

View file

@ -1,8 +1,4 @@
{ { lib, ... }:
lib,
helpers,
...
}:
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "vim-surround"; name = "vim-surround";
package = "vim-surround"; package = "vim-surround";

View file

@ -1,9 +1,4 @@
{ { lib, pkgs, ... }:
lib,
helpers,
pkgs,
...
}:
with lib; with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "vimtex"; name = "vimtex";

View file

@ -1,13 +1,8 @@
{ { lib, ... }:
lib,
helpers,
...
}:
with lib;
lib.nixvim.plugins.mkVimPlugin { lib.nixvim.plugins.mkVimPlugin {
name = "wakatime"; name = "wakatime";
package = "vim-wakatime"; package = "vim-wakatime";
description = "Vim plugin for WakaTime, a time tracking service for developers."; description = "Vim plugin for WakaTime, a time tracking service for developers.";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
} }

View file

@ -1,9 +1,4 @@
{ { lib, ... }:
lib,
config,
options,
...
}:
lib.nixvim.plugins.mkNeovimPlugin { lib.nixvim.plugins.mkNeovimPlugin {
name = "yaml-schema-detect"; name = "yaml-schema-detect";
package = "yaml-schema-detect-nvim"; package = "yaml-schema-detect-nvim";

View file

@ -1,9 +1,4 @@
{ { lib, pkgs, ... }:
lib,
helpers,
pkgs,
...
}@args:
let let
# A list of most cmp source plugins, passed to mkCmpSourcePlugin. # A list of most cmp source plugins, passed to mkCmpSourcePlugin.
@ -183,7 +178,9 @@ let
} }
]; ];
mkCmpSourcePlugin = import ./_mk-cmp-plugin.nix args; mkCmpSourcePlugin = import ./_mk-cmp-plugin.nix {
inherit lib pkgs;
};
pluginModules = builtins.map mkCmpSourcePlugin sources; pluginModules = builtins.map mkCmpSourcePlugin sources;
in in
{ {

View file

@ -12,7 +12,7 @@ let
}; };
generated = makeNixvimWithModule { generated = makeNixvimWithModule {
module = module =
{ regularArg, extraModule, ... }: { extraModule, ... }:
{ {
_module.args = { _module.args = {
regularArg = "regularValue"; regularArg = "regularValue";

View file

@ -4,8 +4,6 @@
lib ? pkgs.lib, lib ? pkgs.lib,
linkFarm, linkFarm,
pkgs, pkgs,
self,
system,
pkgsForTest, pkgsForTest,
}: }:
let let

View file

@ -27,12 +27,7 @@ in
}; };
all = all =
{ { lib, options, ... }:
lib,
pkgs,
options,
...
}:
let let
enableDep = depName: depOption: { enableDep = depName: depOption: {
enable = isDepEnabled depName depOption.package.default; enable = isDepEnabled depName depOption.package.default;

View file

@ -64,7 +64,7 @@ in
}; };
example-multiple-plugin = example-multiple-plugin =
{ pkgs, lib, ... }: { pkgs, ... }:
{ {
extraPlugins = extraPlugins =
with pkgs.vimPlugins; with pkgs.vimPlugins;