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,
config,
self',
system,
...
}:

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"
];
};
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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 ];
}

View file

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

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 = {

View file

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

View file

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

View file

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

View file

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

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.";

View file

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

View file

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

View file

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

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 ];
}

View file

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

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
{

View file

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

View file

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

View file

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

View file

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