From 0fb43cbfb62a46cdfcea7487c397d9f232ac469e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 16 Dec 2024 13:30:28 +0100 Subject: [PATCH] dev/list-plugins: properly error out when parsing is unsuccessfull --- flake-modules/dev/list-plugins.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flake-modules/dev/list-plugins.py b/flake-modules/dev/list-plugins.py index 6e8e3fc2..259f421e 100755 --- a/flake-modules/dev/list-plugins.py +++ b/flake-modules/dev/list-plugins.py @@ -9,12 +9,15 @@ from typing import Optional QUESTION_MARK = "❔" +# Ignore files that are not plugin definitions EXCLUDES: list[str] = [ - # Not plugin files + # Patterns "TEMPLATE.nix", - "colorschemes/base16/theme-list.nix", "deprecations.nix", + "renamed-options", "helpers.nix", + # Specific files + "colorschemes/base16/theme-list.nix", "plugins/by-name/dap/dapHelpers.nix", "plugins/by-name/efmls-configs/packages.nix", "plugins/by-name/gitsigns/options.nix", @@ -194,6 +197,10 @@ def parse_file(path: str) -> Optional[Plugin]: ): kind = Kind.VIM state = State.NEW + else: + raise ValueError( + f"I was not able to categorize `{path}`. Consider adding it to `EXCLUDES` or `KNOWN_PATHS`." + ) return Plugin( path=path,