Skip to content

Commit 8a82177

Browse files
committed
style: apply linter and formatter fixes
1 parent 1e142db commit 8a82177

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

instant_python/config/domain/config_schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from pathlib import Path
44
from typing import TypedDict, Union
55

6-
import yaml
76

87
from instant_python.config.domain.dependency_config import (
98
DependencyConfig,

instant_python/initialize/infra/renderer/jinja_environment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def __init__(self, user_template_path: str) -> None:
1818
loader=ChoiceLoader(
1919
[
2020
FileSystemLoader(user_template_path),
21-
PackageLoader(package_name=self._BASE_PACKAGE_NAME, package_path=self._PROJECT_STRUCTURE_TEMPLATE_PATH),
21+
PackageLoader(
22+
package_name=self._BASE_PACKAGE_NAME, package_path=self._PROJECT_STRUCTURE_TEMPLATE_PATH
23+
),
2224
PackageLoader(package_name=self._BASE_PACKAGE_NAME, package_path=self._BOILERPLATE_TEMPLATE_PATH),
2325
]
2426
),

instant_python/initialize/infra/renderer/jinja_project_renderer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def __init__(self, env: JinjaEnvironment) -> None:
1616
def render(self, context_config: ConfigSchema) -> list[dict]:
1717
template_name = self._get_project_main_structure_template(context_config.template_type)
1818
basic_project_structure = self._render_project_structure_with_jinja(context_config, template_name)
19-
project_structure_with_files_content = self._add_template_content_to_files(context_config, basic_project_structure)
19+
project_structure_with_files_content = self._add_template_content_to_files(
20+
context_config, basic_project_structure
21+
)
2022
return project_structure_with_files_content
2123

2224
def _render_project_structure_with_jinja(self, context_config: ConfigSchema, template_name: str) -> list[dict]:

test/config/domain/test_git_config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ def test_should_allow_to_not_initialize_git(self) -> None:
3030
],
3131
)
3232
def test_should_not_allow_to_initialize_git_if_user_is_not_present(self, username: Union[str, None]) -> None:
33-
expect(lambda: GitConfigMother.with_parameters(username=username)).to(
34-
raise_error(GitUserOrEmailNotPresent)
35-
)
33+
expect(lambda: GitConfigMother.with_parameters(username=username)).to(raise_error(GitUserOrEmailNotPresent))
3634

3735
@pytest.mark.parametrize(
3836
"email",

test/initialize/infra/renderer/test_jinja_environment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ def test_should_render_template_from_default_templates_folder_when_custom_templa
2828
expect(rendered_content).to_not(be_none)
2929

3030
def test_should_raise_error_when_template_is_not_found_anywhere(self) -> None:
31-
expect(lambda: self._jinja_environment.render_template("non_existing_template.j2")).to(raise_error(TemplateNotFound))
31+
expect(lambda: self._jinja_environment.render_template("non_existing_template.j2")).to(
32+
raise_error(TemplateNotFound)
33+
)

test/initialize/infra/renderer/test_jinja_project_renderer.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
class TestJinjaProjectRenderer:
1212
def test_should_render_standard_project_structure(self) -> None:
13-
config = ConfigSchemaMother.with_template(
14-
template=SupportedTemplates.STANDARD.value
15-
)
13+
config = ConfigSchemaMother.with_template(template=SupportedTemplates.STANDARD.value)
1614
renderer = JinjaProjectRenderer(env=JinjaEnvironment(str(resources_path())))
1715

1816
project_structure = renderer.render(context_config=config)
@@ -21,16 +19,13 @@ def test_should_render_standard_project_structure(self) -> None:
2119
expect(project_structure).to_not(be_empty)
2220

2321
def test_should_include_file_template_content_in_project_structure(self) -> None:
24-
config = ConfigSchemaMother.with_template(
25-
template=SupportedTemplates.STANDARD.value
26-
)
22+
config = ConfigSchemaMother.with_template(template=SupportedTemplates.STANDARD.value)
2723
renderer = JinjaProjectRenderer(env=JinjaEnvironment(str(resources_path())))
2824

2925
project_structure = renderer.render(context_config=config)
3026

3127
first_file = next(
32-
(item for item in self._flatten_structure(project_structure) if item.get("type") == "file"),
33-
None
28+
(item for item in self._flatten_structure(project_structure) if item.get("type") == "file"), None
3429
)
3530
expect(first_file).to_not(be_none)
3631
expect(first_file.get("content")).to_not(be_empty)

0 commit comments

Comments
 (0)