Skip to content

Commit

Permalink
Chore: add new lines required by pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Sandi <[email protected]>
Change-Id: I659776622fefceb233f3a444ec38f5174a5d5054
  • Loading branch information
keanjapesan committed Jul 20, 2023
1 parent 7ec5d54 commit 85fdad9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lftools/git/gerrit.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def add_info_job(self, fqdn, gerrit_project, issue_id, agent):
else:
buildnode = "centos7-builder-2c-1g"

jinja_env = Environment(loader=PackageLoader("lftools.git"), autoescape=select_autoescape())
jinja_env = Environment(
loader=PackageLoader("lftools.git"), autoescape=select_autoescape(), keep_trailing_newline=True
)
template = jinja_env.get_template("project.yaml")
content = template.render(
project_name_dashed=gerrit_project_dashed,
Expand All @@ -186,7 +188,9 @@ def add_git_review(self, fqdn, gerrit_project, issue_id):
"""
filename = ".gitreview"

jinja_env = Environment(loader=PackageLoader("lftools.git"), autoescape=select_autoescape())
jinja_env = Environment(
loader=PackageLoader("lftools.git"), autoescape=select_autoescape(), keep_trailing_newline=True
)
template = jinja_env.get_template("gitreview")
content = template.render(fqdn=fqdn, project_name=gerrit_project, default_branch=self.default_branch)
log.debug(".gitreview contents:\n{}".format(content))
Expand Down Expand Up @@ -239,7 +243,9 @@ def add_maven_config(self, fqdn, gerrit_project, issue_id, nexus3_url="", nexus3
except AttributeError:
log.error("Invalid nexus3_ports designated.")

jinja_env = Environment(loader=PackageLoader("lftools.git"), autoescape=select_autoescape())
jinja_env = Environment(
loader=PackageLoader("lftools.git"), autoescape=select_autoescape(), keep_trailing_newline=True
)
template = jinja_env.get_template(params_path)
config_params_content = template.render(project_dashed=project_dashed)
log.debug("config-params.yaml contents:\n{}".format(config_params_content))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Adds new lines at EOF of templates used by lftools to generate automated
Gerrit changes after a new INFO.yaml is merged.

0 comments on commit 85fdad9

Please sign in to comment.