Skip to main content

Allow running ts --fix to fix ruff linting issues

ID
e979155
date
2025-05-06 09:07:35+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
2e7b773
message
Allow running `ts --fix` to fix ruff linting issues
changed files
1 file, 9 additions, 3 deletions

Changed files

ts (1749) → ts (1880)

diff --git a/ts b/ts
index 8918449..228307e 100755
--- a/ts
+++ b/ts
@@ -15,8 +15,14 @@ function run_python_tests() {
     fi
 
     # Run ruff to do Python formatting
-    print_info "-> ruff check"
-    ruff check .
+    if [[ "${1:-}" == "--fix" ]]
+    then
+      print_info "-> ruff check --fix"
+      ruff check --fix .
+    else
+      print_info "-> ruff check"
+      ruff check .
+    fi
     
     echo ""
     
@@ -86,5 +92,5 @@ if test -f Cargo.toml
 then
     run_rust_tests
 else
-    run_python_tests
+    run_python_tests "$@"
 fi