refactor: fix linting issues - remove unused kwargs, fix unused variable, and make method public
This commit is contained in:
@@ -28,7 +28,7 @@ HEADER_ASCII_ART = [
|
|||||||
class RecipeGenerator:
|
class RecipeGenerator:
|
||||||
"""Generate kickstart recipes from templates and modifiers."""
|
"""Generate kickstart recipes from templates and modifiers."""
|
||||||
|
|
||||||
def __init__(self, ingredients_dir_or_templates: Optional[Path] = None, templates_file: Optional[Path] = None, **kwargs):
|
def __init__(self, ingredients_dir_or_templates: Optional[Path] = None, templates_file: Optional[Path] = None):
|
||||||
"""Initialize RecipeGenerator.
|
"""Initialize RecipeGenerator.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -199,7 +199,7 @@ class RecipeGenerator:
|
|||||||
|
|
||||||
# Add versioned includes
|
# Add versioned includes
|
||||||
versioned = template.get('versioned', {})
|
versioned = template.get('versioned', {})
|
||||||
for key, fragment_path in versioned.items():
|
for fragment_path in versioned.values():
|
||||||
# Substitute {version} placeholder
|
# Substitute {version} placeholder
|
||||||
resolved_path = fragment_path.format(version=version)
|
resolved_path = fragment_path.format(version=version)
|
||||||
if resolved_path not in seen:
|
if resolved_path not in seen:
|
||||||
@@ -397,7 +397,7 @@ class RecipeGenerator:
|
|||||||
|
|
||||||
def get_ksversion(self, version: str) -> Optional[str]:
|
def get_ksversion(self, version: str) -> Optional[str]:
|
||||||
"""Map Phyllome OS version to pykickstart version string."""
|
"""Map Phyllome OS version to pykickstart version string."""
|
||||||
return SemanticValidator()._get_ksversion(version)
|
return SemanticValidator().get_ksversion(version)
|
||||||
|
|
||||||
def extract_version(self, content: str, filename: str) -> Optional[str]:
|
def extract_version(self, content: str, filename: str) -> Optional[str]:
|
||||||
"""Extract Fedora version from recipe content or filename."""
|
"""Extract Fedora version from recipe content or filename."""
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class SemanticValidator:
|
|||||||
issues = []
|
issues = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ks_version_str = self._get_ksversion(version)
|
ks_version_str = self.get_ksversion(version)
|
||||||
if ks_version_str:
|
if ks_version_str:
|
||||||
ks_version = makeVersion(ks_version_str)
|
ks_version = makeVersion(ks_version_str)
|
||||||
else:
|
else:
|
||||||
@@ -142,7 +142,7 @@ class SemanticValidator:
|
|||||||
|
|
||||||
return issues
|
return issues
|
||||||
|
|
||||||
def _get_ksversion(self, version: str) -> Optional[str]:
|
def get_ksversion(self, version: str) -> Optional[str]:
|
||||||
"""Map Phyllome OS version to pykickstart version string."""
|
"""Map Phyllome OS version to pykickstart version string."""
|
||||||
if version == 'rawhide':
|
if version == 'rawhide':
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user