diff options
| -rwxr-xr-x[-rw-r--r--] | build.py | 22 | ||||
| -rw-r--r-- | ruff.toml | 3 | ||||
| -rw-r--r-- | utils/salary_visualization.py | 1 |
3 files changed, 14 insertions, 12 deletions
@@ -29,11 +29,10 @@ import re import shutil import subprocess import sys -from html import escape -from urllib.parse import quote from datetime import datetime +from html import escape from pathlib import Path - +from urllib.parse import quote SITE_TEMPLATE_VARS = { "site_name": "cleberg.net", @@ -45,9 +44,7 @@ SITE_TEMPLATE_VARS = { def run_ruff(): print("Running ruff...") for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]: - result = subprocess.run( - cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True - ) + result = subprocess.run(cmd, capture_output=True, text=True, check=False) if result.returncode != 0: print(f"ruff error ({' '.join(cmd)}):") print(result.stderr, file=sys.stderr) @@ -300,9 +297,9 @@ def minify_css(src_css, dest_css): print(f"Minifying CSS: {src_css} → {dest_css}") result = subprocess.run( ["minify", "-o", str(dest_css), str(src_css)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, text=True, + check=False, ) if result.returncode != 0: print("Error during CSS minification:") @@ -314,9 +311,9 @@ def minify_html(src_html, dest_html): print(f"Minifying HTML: {src_html} → {dest_html}") result = subprocess.run( ["minify", "-o", str(dest_html), str(src_html)], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, text=True, + check=False, ) if result.returncode != 0: print("Error during HTML minification:") @@ -333,6 +330,7 @@ def run_emacs_publish(dev_mode=True): stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, + check=False, ) if result.returncode != 0: @@ -538,9 +536,9 @@ def deploy_to_server(build_dir, server): print(f"Deploying .build/ → {remote_path}") result = subprocess.run( ["rsync", "-r", "--delete-before", f"{build_dir}/", remote_path], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, text=True, + check=False, ) if result.returncode != 0: print("Error during rsync deployment:") diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..aae5b0f --- /dev/null +++ b/ruff.toml @@ -0,0 +1,3 @@ +# ruff.toml +[lint] +ignore = ["DTZ006", "DTZ007"] diff --git a/utils/salary_visualization.py b/utils/salary_visualization.py index 8da3704..a4292d8 100644 --- a/utils/salary_visualization.py +++ b/utils/salary_visualization.py @@ -6,6 +6,7 @@ plotly. """ import locale + import pandas as pd import plotly.graph_objs as go from pandas import read_csv as pd_read_csv |
