annotate match conditions

This commit is contained in:
nbe 2023-07-31 05:34:53 +03:00
parent 63a4790e78
commit d0ce1b340f

View File

@ -29,9 +29,9 @@ def get_nixpkgs_name(bin):
def match(command):
bin = command.script_parts[0]
return (
"nix-shell" not in command.script
and "command not found" in command.output
and get_nixpkgs_name(bin)
"nix-shell" not in command.script # avoid recursion # noqa: E501
and "command not found" in command.output # only match commands which had exit code: 127 # noqa: E501
and get_nixpkgs_name(bin) # only match commands which could be made available through nix # noqa: E501
)