Hugoifier
fix(style): resolve all ruff/PEP 8 violations
Commit
d3da269700caa50823f3c6165717b9fd4d88fd8e002313953620a178dd1674bd
Parent
04b8794b3aefc6b…
5 files changed
+1
-1
-2
-1
-1
+1
-2
+1
-1
| --- src/utils/analyze.py | ||
| +++ src/utils/analyze.py | ||
| @@ -44,11 +44,11 @@ | ||
| 44 | 44 | |
| 45 | 45 | report = [ |
| 46 | 46 | f"Theme: {theme_name}", |
| 47 | 47 | f"Theme dir: {theme_dir}", |
| 48 | 48 | f"Layouts ({len(layouts)}):", |
| 49 | - *[f" {l}" for l in sorted(layouts)], | |
| 49 | + *[f" {layout}" for layout in sorted(layouts)], | |
| 50 | 50 | f"Content types: {content_types}", |
| 51 | 51 | f"ExampleSite: {example_site or 'none'}", |
| 52 | 52 | "", |
| 53 | 53 | "Status: Already a Hugo theme. Use 'complete' to assemble a working site.", |
| 54 | 54 | ] |
| 55 | 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" {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 @@ | ||
| 9 | 9 | import logging |
| 10 | 10 | import os |
| 11 | 11 | import re |
| 12 | 12 | import yaml |
| 13 | 13 | |
| 14 | -from config import call_ai | |
| 15 | - | |
| 16 | 14 | DECAP_CDN = "https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js" |
| 17 | 15 | |
| 18 | 16 | # Whitelabel defaults — override via decapify() kwargs or env vars |
| 19 | 17 | DEFAULT_CMS_NAME = os.getenv('CMS_NAME', 'Content Manager') |
| 20 | 18 | DEFAULT_CMS_LOGO = os.getenv('CMS_LOGO_URL', '') # URL or empty |
| 21 | 19 |
| --- 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 |
-1
| --- src/utils/deploy.py | ||
| +++ src/utils/deploy.py | ||
| @@ -2,11 +2,10 @@ | ||
| 2 | 2 | This script handles the deployment of a Hugo site, ensuring all prerequisites are met and executing the deployment process. |
| 3 | 3 | It may use Cloudflare functions for deployment. |
| 4 | 4 | """ |
| 5 | 5 | |
| 6 | 6 | import logging |
| 7 | -import os | |
| 8 | 7 | |
| 9 | 8 | # Function to handle deployment tasks |
| 10 | 9 | def deploy(path, zone): |
| 11 | 10 | logging.info(f"Starting deployment for {path} to zone {zone}...") |
| 12 | 11 | try: |
| 13 | 12 |
| --- 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 @@ | ||
| 3 | 3 | Themes in themes/ are structured as: {name}/{name}/themes/{theme-name}/ |
| 4 | 4 | """ |
| 5 | 5 | |
| 6 | 6 | import logging |
| 7 | 7 | import os |
| 8 | -import glob as glob_module | |
| 9 | 8 | |
| 10 | 9 | |
| 11 | 10 | def find_hugo_theme(input_path): |
| 12 | 11 | """ |
| 13 | 12 | Given a path like themes/revolve-hugo or the inner extracted dir, |
| 14 | 13 |
| --- 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 |
+1
-2
| --- tests/test_config.py | ||
| +++ tests/test_config.py | ||
| @@ -1,10 +1,9 @@ | ||
| 1 | 1 | """Tests for config.py.""" |
| 2 | 2 | import os |
| 3 | -import sys | |
| 4 | 3 | import unittest |
| 5 | -from unittest.mock import patch, MagicMock | |
| 4 | +from unittest.mock import patch | |
| 6 | 5 | |
| 7 | 6 | |
| 8 | 7 | class TestCallAiRouting(unittest.TestCase): |
| 9 | 8 | def _get_config(self): |
| 10 | 9 | # Reload config to pick up env var changes |
| 11 | 10 |
| --- 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 |