Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reuse #456

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,20 @@ in
};
};
};
reuse = mkOption {
description = lib.mdDoc "reuse hook";
type = types.submodule {
imports = [ hookModule ];
options.settings = {
flags = mkOption {
type = types.str;
description = lib.mdDoc "Flags passed to reuse. For available options run 'reuse lint --help'";
default = "";
example = "--json";
};
};
};
};
revive = mkOption {
description = lib.mdDoc "revive hook";
type = types.submodule {
Expand Down Expand Up @@ -3088,6 +3102,15 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
entry = migrateBinPathToPackage hooks.pyupgrade "/bin/pyupgrade";
types = [ "python" ];
};
reuse =
{
name = "reuse";
description = "reuse is a tool for compliance with the REUSE recommendations.";
package = tools.reuse;
entry = "${hooks.reuse.package}/bin/reuse lint ${hooks.reuse.settings.flags}";
types = [ "file" ];
pass_filenames = false;
};
revive =
{
name = "revive";
Expand Down
2 changes: 1 addition & 1 deletion nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ in
inherit (luaPackages) luacheck;
inherit (nodePackages) eslint markdownlint-cli prettier pyright cspell;
inherit (ocamlPackages) ocp-indent;
inherit (python3Packages) autoflake black flake8 flynt isort mkdocs-linkcheck mypy pre-commit-hooks pylint pyupgrade;
inherit (python3Packages) autoflake black flake8 flynt isort mkdocs-linkcheck mypy pre-commit-hooks pylint pyupgrade reuse;
inherit (php82Packages) php-cs-fixer psalm;
# FIXME: workaround build failure
phpstan = php82Packages.phpstan.overrideAttrs (old: {
Expand Down
Loading