Made with
```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
typos --no-check-filenames --write-changes "$1"
git diff --exit-code "$1" && exit
#( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
[[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```
and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`
I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
63 lines
925 B
Nix
63 lines
925 B
Nix
{
|
|
lib,
|
|
fetchPypi,
|
|
buildPythonPackage,
|
|
|
|
# build-system
|
|
incremental,
|
|
setuptools,
|
|
|
|
# dependencies
|
|
attrs,
|
|
hyperlink,
|
|
requests,
|
|
twisted,
|
|
|
|
# tests
|
|
httpbin,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "treq";
|
|
version = "24.9.1";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-Fdp/xATz5O1Z0Kvl+O70lm+rvmGAOaKiO8fBUwXO/qg=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
incremental
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
attrs
|
|
hyperlink
|
|
incremental
|
|
requests
|
|
twisted
|
|
] ++ twisted.optional-dependencies.tls;
|
|
|
|
nativeCheckInputs = [
|
|
httpbin
|
|
twisted
|
|
];
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
|
|
trial treq
|
|
|
|
runHook postCheck
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/twisted/treq";
|
|
description = "Requests-like API built on top of twisted.web's Agent";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
};
|
|
}
|