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

[INFRA] Support for Block Comment Style for Python files #7547

Closed
2 tasks
mikhail-dr opened this issue Aug 23, 2021 · 13 comments · Fixed by apache/skywalking-eyes#100
Closed
2 tasks

[INFRA] Support for Block Comment Style for Python files #7547

mikhail-dr opened this issue Aug 23, 2021 · 13 comments · Fixed by apache/skywalking-eyes#100
Assignees
Labels
good first issue Good first issue for beginners license eye

Comments

@mikhail-dr
Copy link

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • [ X] Question or discussion
  • Bug
  • [ X] Requirement
  • Feature or performance improvement

Question

  • What do you want to know?

There does not appear to be any way to configure the tool to use block comment for the insertion of copyright notice into Python files? The only way I can use block comments for that is if I modify styles.yaml and languages.yaml files?


Bug

  • Which version of SkyWalking, OS, and JRE?

  • Which company or project?

  • What happened?
    If possible, provide a way to reproduce the error. e.g. demo application, component version.


Requirement or improvement

  • I would like to use block style comments, rather than # inline comments to insert copyright notices into Python files. It would be great if such possibility or config option were available in the tool.
@kezhenxu94
Copy link
Member

@mikhail-dr IIRC Python doesn't allow multi line comments, do you mean docstring?

@mikhail-dr
Copy link
Author

@kezhenxu94 yes, correct, docstrings, """. thanks.

@wu-sheng
Copy link
Member

wu-sheng commented Aug 24, 2021

@kezhenxu94 yes, correct, docstrings, """. thanks.

Could do share which project uses this style?

@mikhail-dr
Copy link
Author

we'd like to use """-style docstring, rather than #-style comments for Python files. thanks.

@wu-sheng
Copy link
Member

Hi, my question is which? Is recommended in any Python doc or project? If so, it is reasonable to accept this.
At least we should be able to find more than one top level open source Python projects using in this way.

@mikhail-dr
Copy link
Author

well, this was just an internal preference, to use docstring """, rather than # comments for copyright notice. while i can change the two yaml files to use """ docstring and rebuild the binary (i did do that today and that works), I thought it would be better if that was an official option so that folks could use your official docker image. thanks.

@wu-sheng
Copy link
Member

@kezhenxu94 I noticed no doc on https://hub.docker.com/r/apache/skywalking-eyes. Could you update it?
I think we should or already have yaml override for our image.

@mikhail-dr
Copy link
Author

@wu-sheng do you mean to say that it is already somehow possible to override the default styles.yaml and languages.yaml files? if so, please, let me know how, i found no information on that. thanks.

@wu-sheng
Copy link
Member

do you mean to say that it is already somehow possible to override the default styles.yaml and languages.yaml files? if so, please, let me know how, i found no information on that. thanks.

I think we should have at least. We have this similar feature in other images, same for this too. Let's wait for @kezhenxu94 's confirmation. We are closing to eye 0.2.0. Let's see.

@mikhail-dr
Copy link
Author

@kezhenxu94 any further comments/updates on this? thanks.

@kezhenxu94
Copy link
Member

@kezhenxu94 any further comments/updates on this? thanks.

@mikhail-dr those files styles.yaml and languages.yaml are not overridable for now, and I didn't expect users to override them at all, we might consider another config to allow users to specify using block comments or inline comments

@mikhail-dr
Copy link
Author

ok, thanks.

@kezhenxu94 kezhenxu94 added the good first issue Good first issue for beginners label Sep 8, 2021
@kezhenxu94
Copy link
Member

@mikhail-dr Thanks to @dongzl 's apache/skywalking-eyes#97 and my apache/skywalking-eyes#100 , now you can configure the comment style like this 👇 to use DocString style

header: # `header` section is configurations for source codes license header.
  # ... other configurations
  language:
    Python:
      extensions:
        - ".py"
      comment_style_id: PythonDocStringStyle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good first issue for beginners license eye
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants