Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 9 additions & 1 deletion src/args/lint-python/builder.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# shellcheck shell=bash

function get_package_name {
local package_path="${1}"
local package_dir

: && package_dir="$(basename "${envSrc#*--}")" \
&& echo "${package_dir//-/_}"
}

function main {
# If you do `import XXX` in your python code and the structure is like this:
# /path/to/XXX
Expand All @@ -12,7 +20,7 @@ function main {
local python_dirs
local python_dir

package_name="$(basename "${envSrc#*-}")" \
package_name="$(get_package_name "${envSrc}")" \
&& info Running mypy over: "${package_path}", package "${package_name}" \
&& if ! test -e "${package_path}/py.typed"; then
error This is not a mypy package, py.typed missing
Expand Down
2 changes: 1 addition & 1 deletion src/args/project-path/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ then
name =
if rel == "/"
then "src"
else builtins.baseNameOf rel;
else builtins.replaceStrings ["/"] ["-"] rel;
path = (builtins.unsafeDiscardStringContext projectSrc) + rel;
})
else abort "projectPath arguments must start with: /, currently it is: ${rel}"