|
45 | 45 | "vale" = [ "configPath" "flags" ];
|
46 | 46 | "yamllint" = [ "configPath" ];
|
47 | 47 | })
|
| 48 | + # Rename `rome` hook to `biome`, since `biome` was being used in both hooks |
| 49 | + ++ [ (mkRenamedOptionModule [ "settings" "rome" ] [ "hooks" "biome" "settings" ]) ] |
48 | 50 | # Rename the remaining `settings.<name>` to `hooks.<name>.settings`
|
49 | 51 | ++ map (name: mkRenamedOptionModule [ "settings" name ] [ "hooks" name "settings" ])
|
50 |
| - [ "ansible-lint" "autoflake" "clippy" "cmake-format" "credo" "deadnix" "denofmt" "denolint" "dune-fmt" "eslint" "flake8" "headache" "hlint" "hpack" "isort" "latexindent" "lychee" "mkdocs-linkcheck" "mypy" "nixfmt" "ormolu" "php-cs-fixer" "phpcbf" "phpcs" "phpstan" "prettier" "psalm" "pylint" "pyright" "pyupgrade" "revive" "rome" "statix" ]; |
| 52 | + [ "ansible-lint" "autoflake" "biome" "clippy" "cmake-format" "credo" "deadnix" "denofmt" "denolint" "dune-fmt" "eslint" "flake8" "headache" "hlint" "hpack" "isort" "latexindent" "lychee" "mkdocs-linkcheck" "mypy" "nixfmt" "ormolu" "php-cs-fixer" "phpcbf" "phpcs" "phpstan" "prettier" "psalm" "pylint" "pyright" "pyupgrade" "revive" "statix" ]; |
51 | 53 |
|
52 | 54 | options.hookModule = lib.mkOption {
|
53 | 55 | type = types.deferredModule;
|
|
155 | 157 | };
|
156 | 158 | };
|
157 | 159 | };
|
| 160 | + biome = mkOption { |
| 161 | + description = lib.mdDoc "biome hook"; |
| 162 | + type = types.submodule { |
| 163 | + imports = [ hookModule ]; |
| 164 | + options.settings = { |
| 165 | + binPath = |
| 166 | + mkOption { |
| 167 | + type = types.nullOr types.path; |
| 168 | + description = lib.mdDoc "`biome` binary path. E.g. if you want to use the `biome` in `node_modules`, use `./node_modules/.bin/biome`."; |
| 169 | + default = null; |
| 170 | + defaultText = "\${tools.biome}/bin/biome"; |
| 171 | + }; |
| 172 | + |
| 173 | + write = |
| 174 | + mkOption { |
| 175 | + type = types.bool; |
| 176 | + description = lib.mdDoc "Whether to edit files inplace."; |
| 177 | + default = true; |
| 178 | + }; |
| 179 | + |
| 180 | + configPath = mkOption { |
| 181 | + type = types.str; |
| 182 | + description = lib.mdDoc "Path to the configuration JSON file"; |
| 183 | + # an empty string translates to use default configuration of the |
| 184 | + # underlying biome binary (i.e biome.json if exists) |
| 185 | + default = ""; |
| 186 | + }; |
| 187 | + }; |
| 188 | + }; |
| 189 | + }; |
158 | 190 | black = mkOption {
|
159 | 191 | description = lib.mdDoc "black hook";
|
160 | 192 | type = types.submodule {
|
@@ -1292,36 +1324,6 @@ in
|
1292 | 1324 | };
|
1293 | 1325 | };
|
1294 | 1326 | };
|
1295 |
| - rome = mkOption { |
1296 |
| - description = lib.mdDoc "rome hook"; |
1297 |
| - type = types.submodule { |
1298 |
| - imports = [ hookModule ]; |
1299 |
| - options.settings = { |
1300 |
| - binPath = |
1301 |
| - mkOption { |
1302 |
| - type = types.nullOr types.path; |
1303 |
| - description = lib.mdDoc "`rome` binary path. E.g. if you want to use the `rome` in `node_modules`, use `./node_modules/.bin/rome`."; |
1304 |
| - default = null; |
1305 |
| - defaultText = "\${tools.biome}/bin/biome"; |
1306 |
| - }; |
1307 |
| - |
1308 |
| - write = |
1309 |
| - mkOption { |
1310 |
| - type = types.bool; |
1311 |
| - description = lib.mdDoc "Whether to edit files inplace."; |
1312 |
| - default = true; |
1313 |
| - }; |
1314 |
| - |
1315 |
| - configPath = mkOption { |
1316 |
| - type = types.str; |
1317 |
| - description = lib.mdDoc "Path to the configuration JSON file"; |
1318 |
| - # an empty string translates to use default configuration of the |
1319 |
| - # underlying rome binary (i.e rome.json if exists) |
1320 |
| - default = ""; |
1321 |
| - }; |
1322 |
| - }; |
1323 |
| - }; |
1324 |
| - }; |
1325 | 1327 | rustfmt = mkOption {
|
1326 | 1328 | description = lib.mdDoc ''
|
1327 | 1329 | Additional rustfmt settings
|
@@ -1656,9 +1658,14 @@ in
|
1656 | 1658 | };
|
1657 | 1659 | };
|
1658 | 1660 |
|
| 1661 | + config.warnings = |
| 1662 | + lib.optional cfg.hooks.rome.enable '' |
| 1663 | + The hook `hooks.rome` has been renamed to `hooks.biome`. |
| 1664 | + ''; |
| 1665 | + |
1659 | 1666 | # PLEASE keep this sorted alphabetically.
|
1660 | 1667 | config.hooks = mapAttrs (_: mapAttrs (_: mkDefault))
|
1661 |
| - { |
| 1668 | + rec { |
1662 | 1669 | actionlint =
|
1663 | 1670 | {
|
1664 | 1671 | name = "actionlint";
|
@@ -1722,6 +1729,24 @@ in
|
1722 | 1729 | "${binPath} ${hooks.autoflake.settings.flags}";
|
1723 | 1730 | types = [ "python" ];
|
1724 | 1731 | };
|
| 1732 | + biome = |
| 1733 | + { |
| 1734 | + name = "biome"; |
| 1735 | + description = "A toolchain for web projects, aimed to provide functionalities to maintain them"; |
| 1736 | + types_or = [ "javascript" "jsx" "ts" "tsx" "json" ]; |
| 1737 | + |
| 1738 | + package = tools.biome; |
| 1739 | + entry = |
| 1740 | + let |
| 1741 | + binPath = migrateBinPathToPackage hooks.biome "/bin/biome"; |
| 1742 | + cmdArgs = |
| 1743 | + mkCmdArgs [ |
| 1744 | + [ (hooks.biome.settings.write) "--apply" ] |
| 1745 | + [ (hooks.biome.settings.configPath != "") "--config-path ${hooks.biome.settings.configPath}" ] |
| 1746 | + ]; |
| 1747 | + in |
| 1748 | + "${binPath} check ${cmdArgs}"; |
| 1749 | + }; |
1725 | 1750 | bats =
|
1726 | 1751 | {
|
1727 | 1752 | name = "bats";
|
@@ -3086,24 +3111,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
|
3086 | 3111 | "${hooks.ripsecrets.package}/bin/ripsecrets ${cmdArgs}";
|
3087 | 3112 | types = [ "text" ];
|
3088 | 3113 | };
|
3089 |
| - rome = |
3090 |
| - { |
3091 |
| - name = "rome"; |
3092 |
| - description = "Unified developer tools for JavaScript, TypeScript, and the web"; |
3093 |
| - types_or = [ "javascript" "jsx" "ts" "tsx" "json" ]; |
3094 |
| - |
3095 |
| - package = tools.biome; |
3096 |
| - entry = |
3097 |
| - let |
3098 |
| - binPath = migrateBinPathToPackage hooks.rome "/bin/biome"; |
3099 |
| - cmdArgs = |
3100 |
| - mkCmdArgs [ |
3101 |
| - [ (hooks.rome.settings.write) "--apply" ] |
3102 |
| - [ (hooks.rome.settings.configPath != "") "--config-path ${hooks.rome.settings.configPath}" ] |
3103 |
| - ]; |
3104 |
| - in |
3105 |
| - "${binPath} check ${cmdArgs}"; |
3106 |
| - }; |
| 3114 | + rome = biome; |
3107 | 3115 | ruff =
|
3108 | 3116 | {
|
3109 | 3117 | name = "ruff";
|
|
0 commit comments