summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
Diffstat (limited to 'Biz')
-rw-r--r--Biz/Bild.nix6
-rw-r--r--Biz/Bild/Builder.nix11
-rwxr-xr-xBiz/Dragons/main.py7
-rwxr-xr-xBiz/Ide/repl14
-rw-r--r--Biz/Lint.hs22
-rwxr-xr-xBiz/Que/Client.py9
6 files changed, 48 insertions, 21 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix
index 183e633..9017f17 100644
--- a/Biz/Bild.nix
+++ b/Biz/Bild.nix
@@ -123,18 +123,12 @@ in nixpkgs // { bild = rec {
# this should just be dev tools
buildInputs = with nixpkgs.pkgs; [
bild
- black
ctags
- deadnix
figlet
git
gitlint
- hlint
- indent
lolcat
nixpkgs.haskell.packages.${constants.ghcCompiler}.fast-tags
- ormolu
- shellcheck
wemux
];
shellHook = ''
diff --git a/Biz/Bild/Builder.nix b/Biz/Bild/Builder.nix
index 342569b..8f42733 100644
--- a/Biz/Bild/Builder.nix
+++ b/Biz/Bild/Builder.nix
@@ -63,13 +63,18 @@ let
haskell = stdenv.mkDerivation rec {
inherit name src BIZ_ROOT preBuild;
+ nativeBuildInputs = [ makeWrapper ];
buildInputs = sysdeps_ ++ [
(bild.haskell.ghcWith (p:
(lib.attrsets.attrVals target.langdeps p)
))
];
- installPhase = "install -D ${name} $out/bin/${name}";
buildPhase = compileLine;
+ installPhase = ''
+ install -D ${name} $out/bin/${name}
+ wrapProgram $out/bin/${name} \
+ --prefix PATH : ${lib.makeBinPath sysdeps_}
+ '';
};
c = stdenv.mkDerivation rec {
@@ -89,13 +94,13 @@ let
inherit name src BIZ_ROOT;
propagatedBuildInputs = [ (bild.python.pythonWith (_: langdeps_)) ] ++ sysdeps_;
buildInputs = sysdeps_;
- checkInputs = [(bild.python.pythonWith (p: with p; [black mypy pylint]))];
+ checkInputs = [(bild.python.pythonWith (p: with p; [black mypy])) ruff];
checkPhase = ''
check() {
$@ || { echo "fail: $name: $3"; exit 1; }
}
check python -m black --quiet --exclude 'setup\.py$' --check .
- check python -m pylint --errors-only .
+ check ${ruff}/bin/ruff check .
check python -m mypy --strict --no-error-summary --exclude 'setup\.py$' .
check python -m ${mainModule} test
'';
diff --git a/Biz/Dragons/main.py b/Biz/Dragons/main.py
index 7813f45..7ec80bb 100755
--- a/Biz/Dragons/main.py
+++ b/Biz/Dragons/main.py
@@ -101,7 +101,12 @@ def get_args() -> typing.Any:
"--active-users",
nargs="+",
default=[],
- help="list of active user emails. if not provided, this is loaded from .mailmap",
+ help=" ".join(
+ [
+ "list of active user emails."
+ "if not provided, this is loaded from .mailmap"
+ ]
+ ),
)
cli.add_argument(
"-v",
diff --git a/Biz/Ide/repl b/Biz/Ide/repl
index 5a7b615..cf0378d 100755
--- a/Biz/Ide/repl
+++ b/Biz/Ide/repl
@@ -44,27 +44,27 @@ fi
if [ -z ${var+PORT} ]; then
echo "warn: repl: ghci does not support binding to a port"
fi
- flags+=(--packages "$BILD.private.$packageSet (h: with h; [$langdeps])")
+ flags+=(--packages "$BILD.bild.haskell.ghcWith (h: with h; [$langdeps])")
command=${CMD:-"ghci -i${BIZ_ROOT:?} -ghci-script ${BIZ_ROOT:?}/.ghci ${targets[@]}"}
;;
Scm)
for lib in ${langdeps[@]}; do
- flags+=(--packages "$BILD.private.nixpkgs.guile-${lib}")
+ flags+=(--packages "$BILD.guile-${lib}")
done
- flags+=(--packages "$BILD.private.nixpkgs.guile")
+ flags+=(--packages "$BILD.guile")
command=${CMD:-"guile -L ${BIZ_ROOT:?} -C ${BIZ_ROOT:?}/_/int --r7rs --listen=${PORT:-37146}"}
;;
Lisp)
- flags+=(--packages "$BILD.private.$packageSet (p: with p; [asdf swank $langdeps])")
+ flags+=(--packages "$BILD.bild.$packageSet (p: with p; [asdf swank $langdeps])")
command=${CMD:-"sbcl --eval '(require :asdf)' --eval '(require :swank)' --eval '(swank:create-server :port ${PORT:-4005})' --load $targets"}
;;
Rs)
- flags+=(--packages "$BILD.private.nixpkgs.rustc")
+ flags+=(--packages "$BILD.nixpkgs.rustc")
command=bash
;;
Py)
- langdeps="$langdeps pylint mypy"
- flags+=(--packages "$BILD.private.$packageSet (p: with p; [$langdeps])")
+ langdeps="$langdeps mypy"
+ flags+=(--packages "$BILD.bild.python.pythonWith (p: with p; [$langdeps])")
command=${CMD:-"python -i $targets"}
;;
*)
diff --git a/Biz/Lint.hs b/Biz/Lint.hs
index cba6aef..2742fae 100644
--- a/Biz/Lint.hs
+++ b/Biz/Lint.hs
@@ -5,6 +5,17 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- : out lint
+--
+-- these are actually runtime deps, but bild doesn't (yet) distinguish between
+-- rundeps and sysdeps:
+--
+-- : sys ormolu
+-- : sys hlint
+-- : sys black
+-- : sys ruff
+-- : sys deadnix
+-- : sys shellcheck
+-- : sys indent
module Biz.Lint (main) where
import Alpha
@@ -130,6 +141,14 @@ black =
fixArgs = Just []
}
+ruff :: Linter
+ruff =
+ Linter
+ { exe = "ruff",
+ checkArgs = ["check"],
+ fixArgs = Just ["check", "--fix"]
+ }
+
deadnix :: Linter
deadnix =
Linter
@@ -172,7 +191,8 @@ runOne mode root cwd path_ = results +> traverse_ printResult >> results
lint mode hlint path_
]
Just (Namespace _ Py) ->
- [ lint mode black path_
+ [ lint mode black path_,
+ lint mode ruff path_
]
Just (Namespace _ Sh) -> [lint mode shellcheck path_]
Just (Namespace _ Nix) -> [lint mode deadnix path_]
diff --git a/Biz/Que/Client.py b/Biz/Que/Client.py
index 90e560f..ef6d6d2 100755
--- a/Biz/Que/Client.py
+++ b/Biz/Que/Client.py
@@ -102,10 +102,8 @@ def send(args: argparse.Namespace) -> None:
if args.serve:
logging.debug("serve")
while not time.sleep(1):
- # pylint: disable=consider-using-with
request.urlopen(req, data=data, timeout=MAX_TIMEOUT)
else:
- # pylint: disable=consider-using-with
request.urlopen(req, data=data, timeout=MAX_TIMEOUT)
@@ -198,7 +196,12 @@ def get_args() -> argparse.Namespace:
"infile",
nargs="?",
type=argparse.FileType("rb"),
- help="data to put on the que. use '-' for stdin, otherwise should be a readable file",
+ help=" ".join(
+ [
+ "data to put on the que.",
+ "use '-' for stdin, otherwise should be a readable file",
+ ]
+ ),
)
return cli.parse_args()