diff --git a/rwx/grub/__init__.py b/rwx/grub/__init__.py index aa208c3..572b13e 100644 --- a/rwx/grub/__init__.py +++ b/rwx/grub/__init__.py @@ -1,7 +1,5 @@ """Wrap GRUB commands.""" -from __future__ import annotations - from rwx import cmd, ps cmd.need("grub-mkimage") diff --git a/rwx/ps/__init__.py b/rwx/ps/__init__.py index 3bef50d..81d2320 100644 --- a/rwx/ps/__init__.py +++ b/rwx/ps/__init__.py @@ -1,7 +1,5 @@ """Handle processes.""" -from __future__ import annotations - import subprocess from rwx import Object, txt diff --git a/sh/ffmpeg.sh b/sh/ffmpeg.sh index bcb3a62..57f9d21 100644 --- a/sh/ffmpeg.sh +++ b/sh/ffmpeg.sh @@ -145,8 +145,6 @@ rwx_ffmpeg_output_video_slow() { rwx_ffmpeg_record_hdmi_precision() { local file="${1}" [ -n "${file}" ] || return - # LATER alternative - # shellcheck disable=SC2046,SC2312 set -- \ $(rwx_ffmpeg_input_hdmi) \ $(rwx_ffmpeg_input_dell_precision) \ @@ -160,8 +158,6 @@ rwx_ffmpeg_record_hdmi_precision() { rwx_ffmpeg_record_hdmi_yeti() { local file="${1}" [ -n "${file}" ] || return - # LATER alternative - # shellcheck disable=SC2046,SC2312 set -- \ $(rwx_ffmpeg_input_hdmi) \ $(rwx_ffmpeg_input_blue_yeti) \ @@ -182,8 +178,6 @@ rwx_ffmpeg_reduce() { local from="${3}" local to="${4}" [ -n "${output}" ] || return - # LATER alternative - # shellcheck disable=SC2046,SC2312 set -- \ $(rwx_ffmpeg_input_file "${input}" "${from}" "${to}") \ $(rwx_ffmpeg_output_video_slow) \ diff --git a/sh/lint/lint.sh b/sh/lint/lint.sh index 365773f..5448563 100644 --- a/sh/lint/lint.sh +++ b/sh/lint/lint.sh @@ -1,31 +1,33 @@ # lint code rwx_lint() { local path="${1}" - [ -n "${path}" ] || return 1 - rwx_lint_clean "${path}" - rwx_lint_tasks "${path}" + [ -n "${path}" ] || exit 1 + rwx_lint_clean set \ "python" \ "shell" local code for code in "${@}"; do - rwx_log "" "${code}" + rwx_log "${code}" "rwx_lint_${code}" "${path}" done - rwx_lint_clean "${path}" + rwx_lint_clean } # clean rwx_lint_clean() { local path="${1}" - [ -n "${path}" ] || return 1 - rwx_log "" "clean" "" - py3clean "${path}" + [ -n "${path}" ] || exit 1 + rwx_log "py3clean" + py3clean \ + --verbose \ + "${path}" set \ "mypy" \ "ruff" local tool for tool in "${@}"; do + rwx_log "${tool}" rwx_remove "${path}/.${tool}_cache" done } @@ -40,7 +42,7 @@ rwx_lint_python() { "mypy" \ "ruff" for action in "${@}"; do - rwx_log "" "${action}" + rwx_log "${action}" "rwx_${action}" "${path}" done } @@ -53,7 +55,7 @@ rwx_lint_shell() { "shellcheck" \ "shfmt" for action in "${@}"; do - rwx_log "" "${action}" + rwx_log "${action}" "rwx_${action}" "${path}" done } @@ -67,9 +69,8 @@ rwx_lint_tasks() { "TODO" \ "FIXME" for type in "${@}"; do - rwx_log "" "${type}" + rwx_log "${type}" grep \ - --after "1" \ --directories "recurse" \ --line-number \ " ${type}" \ diff --git a/sh/python.sh b/sh/python.sh deleted file mode 100644 index 44ea181..0000000 --- a/sh/python.sh +++ /dev/null @@ -1,14 +0,0 @@ -# ╭────────╮ -# │ python │ -# ╰────────╯ - -# ╭────────┬──────╮ -# │ python │ venv │ -# ╰────────┴──────╯ - -rwx_python_venv() { - local path="${1}" - [ -d "${path}" ] || return 1 - export VIRTUAL_ENV="${path}" && \ - export PATH="${VIRTUAL_ENV}/bin:${PATH}" -} diff --git a/sh/rescue/hetzner.sh b/sh/rescue/hetzner.sh index 24d6bd0..9d22847 100644 --- a/sh/rescue/hetzner.sh +++ b/sh/rescue/hetzner.sh @@ -63,8 +63,6 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { for device in "${@}"; do members="${members} ${device}2" done - # LATER alternative - # shellcheck disable=SC2086 rwx_fs_raid_create \ "boot" "00000000:00000000:00000000:00000002" ${members} # @@ -89,8 +87,6 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { for device in "${@}"; do members="${members} ${device}1" done - # LATER alternative - # shellcheck disable=SC2086 rwx_fs_raid_create \ "crypt" "00000000:00000000:00000000:00000001" ${members} # encrypt