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

format will remove the comment by mistake #110

Closed
tanruixiang opened this issue Dec 21, 2023 · 3 comments · Fixed by #112
Closed

format will remove the comment by mistake #110

tanruixiang opened this issue Dec 21, 2023 · 3 comments · Fixed by #112

Comments

@tanruixiang
Copy link

Comment //! Load balancer will be removed.
Images ID :7a11b1a12b1d

docker run -it --rm -v $(pwd):/github/workspace ghcr.io/korandoru/hawkeye-native format

before format

// Copyright 2022-2023 CeresDB Project Authors. Licensed under Apache-2.0.

//! Load balancer

use macros::define_result;

after format

// Copyright 2023 The CeresDB Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use macros::define_result;

config

headerPath = "Apache-2.0.txt"

includes = [
    "*.rs",
    "*.toml",
    "*.yml"
]

[properties]
inceptionYear = 2023
copyrightOwner = "The CeresDB Authors"

@spencercjh
Copy link

spencercjh commented Jan 3, 2024

Here is an example to demo.

image

I use the latest code to debug.

https://github.com/korandoru/hawkeye/blob/main/hawkeye-core/src/main/java/io/korandoru/hawkeye/core/header/HeaderParser.java#L115-L127

The rust file's header type is doubleslash_style

image

image

The expected behavior should be doing nothing(NOT appended to inPlaceHeader any more) AFTER reading the blank line after // Copyright 2022-2023 CeresDB Project Authors. licensed under Apache-2.0..

@tisonkun I need ur support to fix it. 😿 😿 😿

@tisonkun tisonkun closed this as completed Jan 3, 2024
@tisonkun tisonkun reopened this Jan 3, 2024
@tisonkun
Copy link
Member

tisonkun commented Jan 3, 2024

The current algorithm is heuristic. We can try to find a better heuristic algorithm but cannot make a structural correctly one.

I will take a look in this week for thinking about it. Thanks for your report @tanruixiang and investigation @spencercjh .

@tisonkun
Copy link
Member

tisonkun commented Jan 3, 2024

Here is a possible fix - #112

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 a pull request may close this issue.

3 participants