kcl-lang / kpm

KCL Package Manager
https://kcl-lang.io
Apache License 2.0
27 stars 44 forks source link

bug: extra newline in kcl.mod #426

Closed zong-zhe closed 2 months ago

zong-zhe commented 3 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

When a dependency is added using kpm, an extra newline is added

image

2. What did you expect to see? (Required)

No extra newline is added.

3. What did you see instead (Required)

image

4. What is your KCL components version? (Required)

The main branch of kpm

Manoramsharma commented 3 months ago

@zong-zhe I have raised a PR solving this issue, as there is one extra newline added in marshal function of /pkg/package/toml.go

liangyuanpeng commented 3 months ago

I think it's also releate with flake tests for test cover

Manoramsharma commented 3 months ago

I think it's also releate with flake tests for test cover

I think it's also releate with flake tests for test cover

Hi @liangyuanpeng I have tried to remove the extra new line in the opened PR, can ypu give more context on flake tests?

Peefy commented 3 months ago

Hello @Manoramsharma cc @zong-zhe

Sorry, I don't think this issue has really been fixed. This PR https://github.com/kcl-lang/kpm/pull/427 just remove extra only one blankline in the kcl.mod file.

  1. kpm init some_pkg will generate a kcl.mod file containing three blank lines instead of one.

image

  1. In the some_pkg folder, run kpm add k8s and kpm add helloworld will generate a kcl.mod file containing two blank lines instead of one.

image