From b9aa1ade8865a9306024a84496e110285c409c34 Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Mon, 29 Jan 2024 14:31:10 -0600 Subject: [PATCH] feat: added prettier.proseWrap setting and added conform to packages --- README.md | 7 +++++++ flake.nix | 10 +++++++++- src/configs/default.nix | 1 + src/configs/prettier.nix | 4 ++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d391ccd..77343e0 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,13 @@ https://developercertificate.org/. Defaults to `false`. +### prettier.proseWrap + +Allows changing the proseWrap setting to one of the known values: `preserve`, +`always`, `never`. + +Defaults to `preserve`. + ### rust.enable If set to true, then `rustfmt.toml` will be created. diff --git a/flake.nix b/flake.nix index 637bed5..a8a7b00 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,7 @@ , conform ? { } , contributorCovenant ? { } , developerCertificateOfOrigin ? { } + , prettier ? { } , rust ? { } , ... }: @@ -37,6 +38,7 @@ conformDefaults = { scopes = [ ]; }; contributorCovenantDefaults = { enable = false; }; developerCertificateOfOriginDefaults = { enable = false; }; + prettierDefaults = { proseWrap = "preserve"; }; rustDefaults = { enable = false; }; text-engine = import ./src/engines/text.nix { @@ -52,11 +54,16 @@ contributorCovenant = contributorCovenantDefaults // contributorCovenant; developerCertificateOfOrigin = developerCertificateOfOriginDefaults // developerCertificateOfOrigin; conform = conformDefaults // conform; + prettier = prettierDefaults // prettier; rust = rustDefaults // rust; }; in { - packages = [ pkgs.lefthook pkgs.treefmt ]; + packages = [ + pkgs.lefthook + pkgs.treefmt + pkgs.conform + ]; shellHook = '' ${configs.shellHook} @@ -73,6 +80,7 @@ contributorCovenant.enable = true; contributorCovenant.contact = "contact@mfgames.com"; developerCertificateOfOrigin.enable = true; + prettier.proseWrap = "always"; }; in { diff --git a/src/configs/default.nix b/src/configs/default.nix index 0b55463..2adb91b 100644 --- a/src/configs/default.nix +++ b/src/configs/default.nix @@ -1,6 +1,7 @@ inputs @ { pkgs , contributorCovenant , developerCertificateOfOrigin +, prettier , rust , ... }: diff --git a/src/configs/prettier.nix b/src/configs/prettier.nix index 3166c3e..ece510a 100644 --- a/src/configs/prettier.nix +++ b/src/configs/prettier.nix @@ -1,7 +1,7 @@ -inputs @ { system, nixago, nixago-exts, ... }: +inputs @ { system, nixago, nixago-exts, prettier, ... }: nixago-exts.prettier.${system} { data = { printWidth = 80; - proseWrap = "always"; + proseWrap = prettier.proseWrap; }; }