Skip to content

[INFRA] License text from .licenserc.yaml should be taken as-is by skywaking-eyes #7556

@mikhail-dr

Description

@mikhail-dr

Please answer these questions before submitting your issue.

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

Question

  • What do you want to know?

Bug

I am currently using version 0.1.0 which is also the latest

  • Which company or project?

  • What happened?

Inserting copyright notice into Python files. License text, specified in .licenserc.yaml isn't taken as-is by the tool. Specifically, the tool adds 1 extra empty line before the license text, but ignores/deletes empty lines after the license text, making it impossible to separate the license text from the code in the file.


Requirement or improvement

When I specify license text in .licenserc.yaml, I should be able to use mechanisms provided by yaml to specify empty lines before or after the license text, if I want to. The tool should not add anything on its own and should not strip anything out. Yaml provides annotation/markup to control how new line characters and spaces are handled within multi-line values. Specifically, I could use `|+' to specify a multiline value (i.e. License text), and that should include any trailing new line characters or spaces. Those should not be stripped out. However, the tool does strip them out.

So, if in .licenserc.yaml file I have the following License text:

    content: |+
      Copyright blah blah

      All rights reserved.

      Some company, Inc. Confidential.

      More text here...


  paths:

then when the tool inserts this text into a Python file, I end up with this:

#
# Copyright blah blah
#
# All rights reserved.
#
# Some company, Inc. Confidential.
#
# More text here...
FIRST LINE OF CODE HERE

As you can see, the tool added 1 empty line before the license text and stripped the extra empty line that I have in the yaml file. As a result, the License text is glued right to the first line of code in the file, and I have no way to add an extra empty line commented out with # there. I think the tool should honor the exact license text that's in the yaml file. Without adding or deleting anything.

Thanks!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions