Skip to content

Commit 1dcbe94

Browse files
dbantyeliask
andauthored
fix: Keep trailing newlines in generated files [#646, #654]. Thanks @eliask!
Co-authored-by: Elias Kunnas <[email protected]>
1 parent 95b7eb3 commit 1dcbe94

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

end_to_end_tests/golden-record/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ dmypy.json
2020
.idea/
2121

2222
/coverage.xml
23-
/.coverage
23+
/.coverage

end_to_end_tests/golden-record/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ If you want to install this client into another project without publishing it (e
8484
1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
8585
1. If that project is not using Poetry:
8686
1. Build a wheel with `poetry build -f wheel`
87-
1. Install that wheel from the other project `pip install <path-to-wheel>`
87+
1. Install that wheel from the other project `pip install <path-to-wheel>`

end_to_end_tests/golden-record/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ exclude = '''
3636

3737
[tool.isort]
3838
line_length = 120
39-
profile = "black"
39+
profile = "black"

openapi_python_client/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ def __init__(
7474
else:
7575
loader = package_loader
7676
self.env: Environment = Environment(
77-
loader=loader, trim_blocks=True, lstrip_blocks=True, extensions=["jinja2.ext.loopcontrols"]
77+
loader=loader,
78+
trim_blocks=True,
79+
lstrip_blocks=True,
80+
extensions=["jinja2.ext.loopcontrols"],
81+
keep_trailing_newline=True,
7882
)
7983

8084
self.project_name: str = config.project_name_override or f"{utils.kebab_case(openapi.title).lower()}-client"

0 commit comments

Comments
 (0)