Skip to content

Conversation

@cchris28
Copy link
Collaborator

I noticed these when creating a new project using the template.

@cchris28 cchris28 requested a review from drewoldag April 14, 2023 18:40
@cchris28 cchris28 linked an issue Apr 14, 2023 that may be closed by this pull request
with:
src: ./src
{% endif %}
{% endif -%}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same a prior comment: Wouldn't this remove the new line at the end of the file when the template is hydrated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it removes the following newline (after the %} in the same line) which leaves the newline at the end of ./src
which is what we want

{%- if create_example_module -%}
from .example_module import *
{% endif %}
{% endif -%}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, you checked this either manually or with CI for the following four cases of hydrated templates:

  • pylint with example module
  • pylint without example module
  • black with example module
  • black without example module

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these passed the CI checks when I committed. Is that sufficient?
I do not trust my local testing as it is easy to make mis steps.

Copy link
Collaborator

@drewoldag drewoldag Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new PR #174 has been merged that expands the CI to include more cases (we avoided doing this in the past because of how quickly this can explode the number of tests) but for here and now, we might as well make use of it.

I'm not sure how to get this PR to run all 12 test cases. Hopefully there's a nicer way that the brute force approach of closing and recreating the PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a gratuitous whitespace change and forced the rebuild. I think we might add this line to ci.yml:

on: workflow_dispatch

Reportedly enables manual running actions
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch

Copy link
Collaborator

@drewoldag drewoldag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for putting this together.

@cchris28 cchris28 merged commit 3f77438 into main Apr 14, 2023
@cchris28 cchris28 deleted the cchris28/add-eol-at-fileend branch April 14, 2023 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ensure template files end with a newline

3 participants