languages/formatters: allow multiple formatters (#1103)

* language/python: allow multiple formatters

* package: add prettier-plugin-astro

* language/astro: fix prettier, remove prettierd

* package: add prettier-plugin-svelte

* language/svelte: fix prettier, remove prettierd

* languages: allow listOf format.type

* deprecations: add warnings for removed format options

* ruby: remove unused variable

* nix: fix outdated references to format.package

* docs: update release note

* treewide: warn deprecation in singleOrListOf

* conform: add definitions for setupOpts.formatters
This commit is contained in:
Ching Pei Yang 2025-11-16 19:49:21 +01:00 committed by GitHub
commit d5da1a14c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 641 additions and 488 deletions

View file

@ -1,4 +1,5 @@
{lib}: let
inherit (builtins) warn toJSON;
inherit (lib.options) mergeEqualOption;
inherit (lib.lists) singleton;
inherit (lib.strings) isString stringLength match;
@ -27,5 +28,14 @@ in {
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
};
singleOrListOf = t: coercedTo t singleton (listOf t);
# no compound types please
deprecatedSingleOrListOf = option: t:
coercedTo
t
(x:
warn ''
${option} no longer accepts non-list values, use [${toJSON x}] instead
''
(singleton x))
(listOf t);
}

View file

@ -10,5 +10,5 @@ in {
inherit (typesDag) dagOf;
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
inherit (typesLanguage) diagnostics mkGrammarOption;
inherit (customTypes) char hexColor mergelessListOf singleOrListOf;
inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf;
}