Commit 2bf00f8311

2bf00f831142d10b767b456de863d0d6e6a5243c

parent: 9c61efa82c

Verified · cmc

cmc <hello@cleberg.net> · 2026-07-30 22:34 UTC

fix python ruff formatting

Layout: unified · split

build.py +10 −12
@@ -29,11 +29,10 @@ import re
29import shutil 29import shutil
30import subprocess 30import subprocess
31import sys 31import sys
32from html import escape
33from urllib.parse import quote
34from datetime import datetime 32from datetime import datetime
33from html import escape
35from pathlib import Path 34from pathlib import Path
36 35from urllib.parse import quote
37 36
38SITE_TEMPLATE_VARS = { 37SITE_TEMPLATE_VARS = {
39 "site_name": "cleberg.net", 38 "site_name": "cleberg.net",
@@ -45,9 +44,7 @@ SITE_TEMPLATE_VARS = {
45def run_ruff(): 44def run_ruff():
46 print("Running ruff...") 45 print("Running ruff...")
47 for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]: 46 for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]:
48 result = subprocess.run( 47 result = subprocess.run(cmd, capture_output=True, text=True, check=False)
49 cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
50 )
51 if result.returncode != 0: 48 if result.returncode != 0:
52 print(f"ruff error ({' '.join(cmd)}):") 49 print(f"ruff error ({' '.join(cmd)}):")
53 print(result.stderr, file=sys.stderr) 50 print(result.stderr, file=sys.stderr)
@@ -300,9 +297,9 @@ def minify_css(src_css, dest_css):
300 print(f"Minifying CSS: {src_css} → {dest_css}") 297 print(f"Minifying CSS: {src_css} → {dest_css}")
301 result = subprocess.run( 298 result = subprocess.run(
302 ["minify", "-o", str(dest_css), str(src_css)], 299 ["minify", "-o", str(dest_css), str(src_css)],
303 stdout=subprocess.PIPE, 300 capture_output=True,
304 stderr=subprocess.PIPE,
305 text=True, 301 text=True,
302 check=False,
306 ) 303 )
307 if result.returncode != 0: 304 if result.returncode != 0:
308 print("Error during CSS minification:") 305 print("Error during CSS minification:")
@@ -314,9 +311,9 @@ def minify_html(src_html, dest_html):
314 print(f"Minifying HTML: {src_html} → {dest_html}") 311 print(f"Minifying HTML: {src_html} → {dest_html}")
315 result = subprocess.run( 312 result = subprocess.run(
316 ["minify", "-o", str(dest_html), str(src_html)], 313 ["minify", "-o", str(dest_html), str(src_html)],
317 stdout=subprocess.PIPE, 314 capture_output=True,
318 stderr=subprocess.PIPE,
319 text=True, 315 text=True,
316 check=False,
320 ) 317 )
321 if result.returncode != 0: 318 if result.returncode != 0:
322 print("Error during HTML minification:") 319 print("Error during HTML minification:")
@@ -333,6 +330,7 @@ def run_emacs_publish(dev_mode=True):
333 stdout=subprocess.PIPE, 330 stdout=subprocess.PIPE,
334 stderr=subprocess.STDOUT, 331 stderr=subprocess.STDOUT,
335 text=True, 332 text=True,
333 check=False,
336 ) 334 )
337 335
338 if result.returncode != 0: 336 if result.returncode != 0:
@@ -538,9 +536,9 @@ def deploy_to_server(build_dir, server):
538 print(f"Deploying .build/ → {remote_path}") 536 print(f"Deploying .build/ → {remote_path}")
539 result = subprocess.run( 537 result = subprocess.run(
540 ["rsync", "-r", "--delete-before", f"{build_dir}/", remote_path], 538 ["rsync", "-r", "--delete-before", f"{build_dir}/", remote_path],
541 stdout=subprocess.PIPE, 539 capture_output=True,
542 stderr=subprocess.PIPE,
543 text=True, 540 text=True,
541 check=False,
544 ) 542 )
545 if result.returncode != 0: 543 if result.returncode != 0:
546 print("Error during rsync deployment:") 544 print("Error during rsync deployment:")
ruff.toml added +3
@@ -0,0 +1,3 @@
1# ruff.toml
2[lint]
3ignore = ["DTZ006", "DTZ007"]
utils/salary_visualization.py +1
@@ -6,6 +6,7 @@ plotly.
6""" 6"""
7 7
8import locale 8import locale
9
9import pandas as pd 10import pandas as pd
10import plotly.graph_objs as go 11import plotly.graph_objs as go
11from pandas import read_csv as pd_read_csv 12from pandas import read_csv as pd_read_csv