Hugoifier

fix(style): resolve all ruff/PEP 8 violations

lmata 2026-03-12 21:58 trunk
Commit d3da269700caa50823f3c6165717b9fd4d88fd8e002313953620a178dd1674bd
--- src/utils/analyze.py
+++ src/utils/analyze.py
@@ -44,11 +44,11 @@
4444
4545
report = [
4646
f"Theme: {theme_name}",
4747
f"Theme dir: {theme_dir}",
4848
f"Layouts ({len(layouts)}):",
49
- *[f" {l}" for l in sorted(layouts)],
49
+ *[f" {layout}" for layout in sorted(layouts)],
5050
f"Content types: {content_types}",
5151
f"ExampleSite: {example_site or 'none'}",
5252
"",
5353
"Status: Already a Hugo theme. Use 'complete' to assemble a working site.",
5454
]
5555
--- src/utils/analyze.py
+++ src/utils/analyze.py
@@ -44,11 +44,11 @@
44
45 report = [
46 f"Theme: {theme_name}",
47 f"Theme dir: {theme_dir}",
48 f"Layouts ({len(layouts)}):",
49 *[f" {l}" for l in sorted(layouts)],
50 f"Content types: {content_types}",
51 f"ExampleSite: {example_site or 'none'}",
52 "",
53 "Status: Already a Hugo theme. Use 'complete' to assemble a working site.",
54 ]
55
--- src/utils/analyze.py
+++ src/utils/analyze.py
@@ -44,11 +44,11 @@
44
45 report = [
46 f"Theme: {theme_name}",
47 f"Theme dir: {theme_dir}",
48 f"Layouts ({len(layouts)}):",
49 *[f" {layout}" for layout in sorted(layouts)],
50 f"Content types: {content_types}",
51 f"ExampleSite: {example_site or 'none'}",
52 "",
53 "Status: Already a Hugo theme. Use 'complete' to assemble a working site.",
54 ]
55
--- src/utils/decapify.py
+++ src/utils/decapify.py
@@ -9,12 +9,10 @@
99
import logging
1010
import os
1111
import re
1212
import yaml
1313
14
-from config import call_ai
15
-
1614
DECAP_CDN = "https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"
1715
1816
# Whitelabel defaults — override via decapify() kwargs or env vars
1917
DEFAULT_CMS_NAME = os.getenv('CMS_NAME', 'Content Manager')
2018
DEFAULT_CMS_LOGO = os.getenv('CMS_LOGO_URL', '') # URL or empty
2119
--- src/utils/decapify.py
+++ src/utils/decapify.py
@@ -9,12 +9,10 @@
9 import logging
10 import os
11 import re
12 import yaml
13
14 from config import call_ai
15
16 DECAP_CDN = "https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"
17
18 # Whitelabel defaults — override via decapify() kwargs or env vars
19 DEFAULT_CMS_NAME = os.getenv('CMS_NAME', 'Content Manager')
20 DEFAULT_CMS_LOGO = os.getenv('CMS_LOGO_URL', '') # URL or empty
21
--- src/utils/decapify.py
+++ src/utils/decapify.py
@@ -9,12 +9,10 @@
9 import logging
10 import os
11 import re
12 import yaml
13
 
 
14 DECAP_CDN = "https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"
15
16 # Whitelabel defaults — override via decapify() kwargs or env vars
17 DEFAULT_CMS_NAME = os.getenv('CMS_NAME', 'Content Manager')
18 DEFAULT_CMS_LOGO = os.getenv('CMS_LOGO_URL', '') # URL or empty
19
--- src/utils/deploy.py
+++ src/utils/deploy.py
@@ -2,11 +2,10 @@
22
This script handles the deployment of a Hugo site, ensuring all prerequisites are met and executing the deployment process.
33
It may use Cloudflare functions for deployment.
44
"""
55
66
import logging
7
-import os
87
98
# Function to handle deployment tasks
109
def deploy(path, zone):
1110
logging.info(f"Starting deployment for {path} to zone {zone}...")
1211
try:
1312
--- src/utils/deploy.py
+++ src/utils/deploy.py
@@ -2,11 +2,10 @@
2 This script handles the deployment of a Hugo site, ensuring all prerequisites are met and executing the deployment process.
3 It may use Cloudflare functions for deployment.
4 """
5
6 import logging
7 import os
8
9 # Function to handle deployment tasks
10 def deploy(path, zone):
11 logging.info(f"Starting deployment for {path} to zone {zone}...")
12 try:
13
--- src/utils/deploy.py
+++ src/utils/deploy.py
@@ -2,11 +2,10 @@
2 This script handles the deployment of a Hugo site, ensuring all prerequisites are met and executing the deployment process.
3 It may use Cloudflare functions for deployment.
4 """
5
6 import logging
 
7
8 # Function to handle deployment tasks
9 def deploy(path, zone):
10 logging.info(f"Starting deployment for {path} to zone {zone}...")
11 try:
12
--- src/utils/theme_finder.py
+++ src/utils/theme_finder.py
@@ -3,11 +3,10 @@
33
Themes in themes/ are structured as: {name}/{name}/themes/{theme-name}/
44
"""
55
66
import logging
77
import os
8
-import glob as glob_module
98
109
1110
def find_hugo_theme(input_path):
1211
"""
1312
Given a path like themes/revolve-hugo or the inner extracted dir,
1413
--- src/utils/theme_finder.py
+++ src/utils/theme_finder.py
@@ -3,11 +3,10 @@
3 Themes in themes/ are structured as: {name}/{name}/themes/{theme-name}/
4 """
5
6 import logging
7 import os
8 import glob as glob_module
9
10
11 def find_hugo_theme(input_path):
12 """
13 Given a path like themes/revolve-hugo or the inner extracted dir,
14
--- src/utils/theme_finder.py
+++ src/utils/theme_finder.py
@@ -3,11 +3,10 @@
3 Themes in themes/ are structured as: {name}/{name}/themes/{theme-name}/
4 """
5
6 import logging
7 import os
 
8
9
10 def find_hugo_theme(input_path):
11 """
12 Given a path like themes/revolve-hugo or the inner extracted dir,
13
--- tests/test_config.py
+++ tests/test_config.py
@@ -1,10 +1,9 @@
11
"""Tests for config.py."""
22
import os
3
-import sys
43
import unittest
5
-from unittest.mock import patch, MagicMock
4
+from unittest.mock import patch
65
76
87
class TestCallAiRouting(unittest.TestCase):
98
def _get_config(self):
109
# Reload config to pick up env var changes
1110
--- tests/test_config.py
+++ tests/test_config.py
@@ -1,10 +1,9 @@
1 """Tests for config.py."""
2 import os
3 import sys
4 import unittest
5 from unittest.mock import patch, MagicMock
6
7
8 class TestCallAiRouting(unittest.TestCase):
9 def _get_config(self):
10 # Reload config to pick up env var changes
11
--- tests/test_config.py
+++ tests/test_config.py
@@ -1,10 +1,9 @@
1 """Tests for config.py."""
2 import os
 
3 import unittest
4 from unittest.mock import patch
5
6
7 class TestCallAiRouting(unittest.TestCase):
8 def _get_config(self):
9 # Reload config to pick up env var changes
10

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button