5aba99242e
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.
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
pythonOlder,
|
|
fetchPypi,
|
|
setuptools,
|
|
versioningit,
|
|
attrs,
|
|
platformdirs,
|
|
tomli,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pueblo";
|
|
version = "0.0.11";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.11";
|
|
|
|
# This tarball doesn't include tests unfortunately, and the GitHub tarball
|
|
# could have been an alternative, but versioningit fails to detect the
|
|
# version of it correctly, even with setuptools-scm and
|
|
# SETUPTOOLS_SCM_PRETEND_VERSION = version added. Since this is a pure Python
|
|
# package, we can rely on upstream to run the tests before releasing, and it
|
|
# should work for us as well.
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-IQ5NFn1EMh5oLgRlth7VWQmSyMx2/7cmC/U1VW1B4OE=";
|
|
};
|
|
|
|
build-system = [
|
|
setuptools
|
|
versioningit
|
|
];
|
|
|
|
dependencies = [
|
|
attrs
|
|
platformdirs
|
|
tomli
|
|
];
|
|
|
|
doCheck = false; # no tests in sdist
|
|
|
|
pythonImportsCheck = [ "pueblo" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python toolbox library";
|
|
homepage = "https://github.com/pyveci/pueblo";
|
|
license = licenses.lgpl3Only;
|
|
maintainers = with maintainers; [ doronbehar ];
|
|
};
|
|
}
|