Skip to content

Commit fe059cd

Browse files
committed
flake: add nixf-diagnose to treefmt config
Checks nixd's diagnostic lints using libnixf.
1 parent 74423f4 commit fe059cd

File tree

38 files changed

+53
-171
lines changed

38 files changed

+53
-171
lines changed

flake/dev/devshell.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
{
99
pkgs,
1010
config,
11-
self',
1211
system,
1312
...
1413
}:

flake/dev/fmt.nix

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
];
66

77
perSystem =
8-
{ config, pkgs, ... }:
8+
{ pkgs, ... }:
99
{
1010
treefmt.config = {
1111
projectRootFile = "flake.nix";
@@ -15,6 +15,10 @@
1515
# keep-sorted start block=yes newline_separated=no
1616
isort.enable = true;
1717
keep-sorted.enable = true;
18+
nixf-diagnose = {
19+
enable = true;
20+
priority = -1;
21+
};
1822
nixfmt = {
1923
enable = true;
2024
package = pkgs.nixfmt-rfc-style;
@@ -30,6 +34,7 @@
3034
shfmt.enable = true;
3135
statix = {
3236
enable = true;
37+
priority = -2;
3338
disabled-lints = [
3439
# We often use `nullable == true`
3540
"bool_comparison"
@@ -58,6 +63,14 @@
5863
"docs/gfm-alerts-to-admonitions/tests/**/*.yml"
5964
];
6065
formatter.ruff-format.options = [ "--isolated" ];
66+
formatter.nixf-diagnose.options = [
67+
"--auto-fix"
68+
"--ignore=sema-unused-def-lambda-witharg-formal"
69+
];
70+
formatter.nixf-diagnose.excludes = [
71+
# sema-unused-def-lambda-noarg-formal
72+
"ci/rust-analyzer/default.nix"
73+
];
6174
};
6275
};
6376

flake/overlays.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
{
33
imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
44
perSystem =
5-
{
6-
config,
7-
pkgs,
8-
final,
9-
...
10-
}:
5+
{ config, ... }:
116
{
127
overlayAttrs = {
138
nixvim = {

flake/wrappers.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}:
66
{
77
perSystem =
8-
{ system, pkgs, ... }:
8+
{ system, ... }:
99
{
1010
_module.args = {
1111
makeNixvimWithModule = import ../wrappers/standalone.nix {

modules/highlights.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
{
2-
lib,
3-
helpers,
4-
config,
5-
...
6-
}:
1+
{ lib, config, ... }:
72
{
83
options = {
94
highlight = lib.mkOption {

plugins/by-name/barbar/default.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
{
2-
config,
3-
lib,
4-
options,
5-
...
6-
}:
1+
{ config, lib, ... }:
72
with lib;
83
let
94
inherit (lib.nixvim)

plugins/by-name/bufferline/default.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
{
2-
lib,
3-
options,
4-
config,
5-
...
6-
}:
1+
{ lib, config, ... }:
72
let
83
inherit (lib) types;
94
inherit (lib.nixvim) defaultNullOpts mkSettingsRenamedOptionModules;

plugins/by-name/commentary/default.nix

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{
2-
lib,
3-
helpers,
4-
...
5-
}:
1+
{ lib, ... }:
62
lib.nixvim.plugins.mkVimPlugin {
73
name = "commentary";
84
package = "vim-commentary";

plugins/by-name/copilot-lua/default.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
{
2-
config,
3-
lib,
4-
pkgs,
5-
...
6-
}:
1+
{ config, lib, ... }:
72
let
83
inherit (lib) types;
94
inherit (lib.nixvim) defaultNullOpts;

plugins/by-name/coq-thirdparty/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
lib,
3-
helpers,
43
config,
54
pkgs,
65
...

0 commit comments

Comments
 (0)