From e4178bda5d7d7be1d0e1bfb0e7291a03978fafe2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 31 Jan 2025 18:42:58 +0100 Subject: [PATCH] python/ruff --- sh/lint/python.sh | 7 +++++-- sh/lint/ruff.sh | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 sh/lint/ruff.sh diff --git a/sh/lint/python.sh b/sh/lint/python.sh index ab3a735..6f4cef2 100644 --- a/sh/lint/python.sh +++ b/sh/lint/python.sh @@ -3,8 +3,11 @@ rwx_python_lint() { local path="${1}" # check pydoc rwx_log "pydoc" - pydoclint "${path}" + rwx_pydoclint "${path}" # check typing rwx_log "mypy" - mypy "${path}" + rwx_mypy "${path}" + # ruff + rwx_log "ruff" + rwx_ruff "${path}" } diff --git a/sh/lint/ruff.sh b/sh/lint/ruff.sh new file mode 100644 index 0000000..89757f2 --- /dev/null +++ b/sh/lint/ruff.sh @@ -0,0 +1,13 @@ +rwx_ruff() { + local path="${1}" + rwx_ruff_format \ + "${path}" +} + +rwx_ruff_format() { + local path="${1}" + ruff format \ + --diff \ + --line-length 80 \ + "${path}" +}