flake: add nixf-diagnose to treefmt config

Checks nixd's diagnostic lints using libnixf.
This commit is contained in:
Matt Sturgeon
2025-10-01 00:42:40 +00:00
parent 74423f4a53
commit fe059cd395
38 changed files with 53 additions and 171 deletions
-1
View File
@@ -8,7 +8,6 @@
{
pkgs,
config,
self',
system,
...
}:
+14 -1
View File
@@ -5,7 +5,7 @@
];
perSystem =
{ config, pkgs, ... }:
{ pkgs, ... }:
{
treefmt.config = {
projectRootFile = "flake.nix";
@@ -15,6 +15,10 @@
# keep-sorted start block=yes newline_separated=no
isort.enable = true;
keep-sorted.enable = true;
nixf-diagnose = {
enable = true;
priority = -1;
};
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
@@ -30,6 +34,7 @@
shfmt.enable = true;
statix = {
enable = true;
priority = -2;
disabled-lints = [
# We often use `nullable == true`
"bool_comparison"
@@ -58,6 +63,14 @@
"docs/gfm-alerts-to-admonitions/tests/**/*.yml"
];
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"
];
};
};
+1 -6
View File
@@ -2,12 +2,7 @@
{
imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
perSystem =
{
config,
pkgs,
final,
...
}:
{ config, ... }:
{
overlayAttrs = {
nixvim = {
+1 -1
View File
@@ -5,7 +5,7 @@
}:
{
perSystem =
{ system, pkgs, ... }:
{ system, ... }:
{
_module.args = {
makeNixvimWithModule = import ../wrappers/standalone.nix {
+1 -6
View File
@@ -1,9 +1,4 @@
{
lib,
helpers,
config,
...
}:
{ lib, config, ... }:
{
options = {
highlight = lib.mkOption {
+1 -6
View File
@@ -1,9 +1,4 @@
{
config,
lib,
options,
...
}:
{ config, lib, ... }:
with lib;
let
inherit (lib.nixvim)
+1 -6
View File
@@ -1,9 +1,4 @@
{
lib,
options,
config,
...
}:
{ lib, config, ... }:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules;
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkVimPlugin {
name = "commentary";
package = "vim-commentary";
+1 -6
View File
@@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}:
{ config, lib, ... }:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts;
-1
View File
@@ -1,6 +1,5 @@
{
lib,
helpers,
config,
pkgs,
...
-1
View File
@@ -3,7 +3,6 @@
helpers,
config,
pkgs,
options,
...
}:
with lib;
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkVimPlugin {
name = "endwise";
package = "vim-endwise";
+1 -6
View File
@@ -1,9 +1,4 @@
{
lib,
config,
options,
...
}:
{ lib, config, ... }:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts;
+2 -8
View File
@@ -1,16 +1,10 @@
{
lib,
helpers,
config,
...
}:
with lib;
{ lib, config, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "headlines";
package = "headlines-nvim";
description = "A plugin that adds horizontal highlights for text filetypes, like markdown, orgmode, and neorg.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
settingsExample = {
org.headline_highlights = false;
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkVimPlugin {
name = "helm";
package = "vim-helm";
+1 -6
View File
@@ -1,9 +1,4 @@
{
lib,
helpers,
config,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "hunk";
package = "hunk-nvim";
+1 -5
View File
@@ -1,8 +1,4 @@
{
helpers,
lib,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "idris2";
package = "idris2-nvim";
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "lsp-lines";
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
pkgs,
...
}:
{ lib, ... }:
let
inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules;
inherit (lib) types;
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkVimPlugin {
name = "nix";
package = "vim-nix";
+2 -7
View File
@@ -1,9 +1,4 @@
{
lib,
helpers,
...
}:
with lib;
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "preview";
package = "Preview-nvim";
@@ -11,5 +6,5 @@ lib.nixvim.plugins.mkNeovimPlugin {
hasSettings = false;
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
}
+1 -6
View File
@@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}:
{ config, lib, ... }:
let
inherit (lib) mkRemovedOptionModule types;
inherit (lib.nixvim) defaultNullOpts;
+1 -2
View File
@@ -2,7 +2,6 @@
lib,
helpers,
config,
pkgs,
...
}:
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 = {
server = {
@@ -1,8 +1,4 @@
{
lib,
helpers,
pkgs,
}:
{ lib, helpers }:
with lib;
{
tools =
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "smart-splits";
package = "smart-splits-nvim";
+1 -6
View File
@@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "timerly";
package = "timerly";
@@ -1,6 +1,5 @@
{
lib,
helpers,
config,
pkgs,
...
+2 -7
View File
@@ -1,11 +1,6 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
with lib;
with lib.nixvim.plugins;
mkVimPlugin {
lib.nixvim.plugins.mkVimPlugin {
name = "undotree";
globalPrefix = "undotree_";
description = "The undo history visualizer for Vim.";
+1 -1
View File
@@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "vim-be-good";
package = "vim-be-good";
+1 -5
View File
@@ -1,8 +1,4 @@
{
lib,
helpers,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkVimPlugin {
name = "vim-surround";
package = "vim-surround";
+1 -6
View File
@@ -1,9 +1,4 @@
{
lib,
helpers,
pkgs,
...
}:
{ lib, pkgs, ... }:
with lib;
lib.nixvim.plugins.mkVimPlugin {
name = "vimtex";
+2 -7
View File
@@ -1,13 +1,8 @@
{
lib,
helpers,
...
}:
with lib;
{ lib, ... }:
lib.nixvim.plugins.mkVimPlugin {
name = "wakatime";
package = "vim-wakatime";
description = "Vim plugin for WakaTime, a time tracking service for developers.";
maintainers = [ maintainers.GaetanLepage ];
maintainers = [ lib.maintainers.GaetanLepage ];
}
@@ -1,9 +1,4 @@
{
lib,
config,
options,
...
}:
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "yaml-schema-detect";
package = "yaml-schema-detect-nvim";
+4 -7
View File
@@ -1,9 +1,4 @@
{
lib,
helpers,
pkgs,
...
}@args:
{ lib, pkgs, ... }:
let
# 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;
in
{
+1 -1
View File
@@ -12,7 +12,7 @@ let
};
generated = makeNixvimWithModule {
module =
{ regularArg, extraModule, ... }:
{ extraModule, ... }:
{
_module.args = {
regularArg = "regularValue";
-2
View File
@@ -4,8 +4,6 @@
lib ? pkgs.lib,
linkFarm,
pkgs,
self,
system,
pkgsForTest,
}:
let
+1 -6
View File
@@ -27,12 +27,7 @@ in
};
all =
{
lib,
pkgs,
options,
...
}:
{ lib, options, ... }:
let
enableDep = depName: depOption: {
enable = isDepEnabled depName depOption.package.default;
@@ -64,7 +64,7 @@ in
};
example-multiple-plugin =
{ pkgs, lib, ... }:
{ pkgs, ... }:
{
extraPlugins =
with pkgs.vimPlugins;