Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a header on all files indicating they've been generated #598

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ktekelioglu
Copy link

@ktekelioglu ktekelioglu commented Aug 3, 2022

Before this PR

Fixes #596

After this PR

==COMMIT_MSG==
Add a header on all files indicating they've been generated by conjure-python
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Aug 3, 2022

Generate changelog in changelog/@unreleased

Type
See change types. Select one:

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Add a header on python files indicating they've been generated by conjure-python

Check the box to generate changelog(s)

  • Generate changelog entry

@Override
default void emit(PythonPoetWriter poetWriter) {
poetWriter.writeLine("# coding=utf-8");

if (fileName().endsWith(".py")) {
Copy link
Author

Choose a reason for hiding this comment

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

I'm not exactly happy with this solution. Another idea is to distinguish between python/non-python files through another interface in the inheritence model, but that would amount to a larger refactor. Let me know if that would be preferred over this.

Copy link
Contributor

Choose a reason for hiding this comment

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

why not render it on top of all files?

Copy link
Author

Choose a reason for hiding this comment

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

I would say we may need a different comment block, but looks like # is fine for yaml & python (as can be seen by the existing coding comment)

I'll go ahead and make this change

@ktekelioglu ktekelioglu changed the title Add a header on python files indicating they've been generated Add a header on all files indicating they've been generated Aug 3, 2022
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.

Add a header for autogenerated classes
2 participants