Skip to content

Commit

Permalink
hooks: add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Jan 19, 2025
1 parent bad3586 commit baf942e
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,16 @@ in
mkOption {
type = types.nullOr (types.oneOf [ types.str types.path ]);
description = ''
`biome` binary path. For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`.
`biome` binary path.
For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`.
'';
default = null;
defaultText = lib.literalExpression ''
"''${tools.biome}/bin/biome"
'';
example = lib.literalExpression ''
"./node_modules/.bin/biome"
'';
};

write =
Expand Down Expand Up @@ -468,10 +475,16 @@ in
mkOption {
type = types.nullOr (types.oneOf [ types.str types.path ]);
description = ''
`eslint` binary path. For example, if you want to use the `eslint` binary from `node_modules`, use `"./node_modules/.bin/eslint"`.
`eslint` binary path.
For example, if you want to use the `eslint` binary from `node_modules`, use `"./node_modules/.bin/eslint"`.
'';
default = null;
defaultText = lib.literalExpression "\${tools.eslint}/bin/eslint";
defaultText = lib.literalExpression ''
"''${tools.eslint}/bin/eslint"
'';
example = lib.literalExpression ''
"./node_modules/.bin/eslint"
'';
};

extensions =
Expand All @@ -492,7 +505,7 @@ in
binPath =
mkOption {
type = types.nullOr types.str;
description = "flake8 binary path. Should be used to specify flake8 binary from your Nix-managed Python environment.";
description = "flake8 binary path. Should be used to specify flake8 binary from your Python environment.";
default = null;
defaultText = lib.literalExpression ''
"''${tools.flake8}/bin/flake8"
Expand Down Expand Up @@ -826,7 +839,7 @@ in
binPath =
mkOption {
type = types.nullOr (types.oneOf [ types.str types.path ]);
description = "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Nix-managed Python environment.";
description = "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Python environment.";
default = null;
defaultText = lib.literalExpression ''
"''${tools.mkdocs-linkcheck}/bin/mkdocs-linkcheck"
Expand Down Expand Up @@ -1050,13 +1063,17 @@ in
binPath =
mkOption {
description = ''
`prettier` binary path. For example, if you want to use the `prettier` binary from `node_modules`, use `"./node_modules/.bin/prettier"`.
`prettier` binary path.
For example, if you want to use the `prettier` binary from `node_modules`, use `"./node_modules/.bin/prettier"`.
'';
type = types.nullOr (types.oneOf [ types.str types.path ]);
default = null;
defaultText = lib.literalExpression ''
"''${tools.prettier}/bin/prettier"
'';
example = lib.literalExpression ''
"./node_modules/.bin/prettier"
'';
};
allow-parens =
mkOption {
Expand Down Expand Up @@ -1311,7 +1328,7 @@ in
binPath =
mkOption {
type = types.nullOr types.str;
description = "Pylint binary path. Should be used to specify Pylint binary from your Nix-managed Python environment.";
description = "Pylint binary path. Should be used to specify Pylint binary from your Python environment.";
default = null;
defaultText = lib.literalExpression ''
"''${tools.pylint}/bin/pylint"
Expand Down Expand Up @@ -1357,7 +1374,7 @@ in
binPath =
mkOption {
type = types.nullOr types.str;
description = "pyupgrade binary path. Should be used to specify the pyupgrade binary from your Nix-managed Python environment.";
description = "pyupgrade binary path. Should be used to specify the pyupgrade binary from your Python environment.";
default = null;
defaultText = lib.literalExpression ''
"''${tools.pyupgrade}/bin/pyupgrade"
Expand Down Expand Up @@ -1420,10 +1437,16 @@ in
mkOption {
type = types.nullOr (types.oneOf [ types.str types.path ]);
description = ''
`biome` binary path. For example, if you want to use the `biome` binary from `node_modules`, use `"./node_modules/.bin/biome"`.
`rome` binary path.
For example, if you want to use the `rome` binary from `node_modules`, use `"./node_modules/.bin/rome"`.
'';
default = null;
defaultText = "\${tools.biome}/bin/biome";
defaultText = lib.literalExpression ''
"''${tools.rome}/bin/rome
'';
example = lib.literalExpression ''
"./node_modules/.bin/rome"
'';
};

write =
Expand Down

0 comments on commit baf942e

Please sign in to comment.