-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: heuristic find header - blank lines after first comments should …
…terminate (#112) Signed-off-by: tison <wander4096@gmail.com>
- Loading branch information
Showing
7 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main.rs.formatted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
baseDir = "src/test/data/issue-110" | ||
|
||
headerPath = "Apache-2.0.txt" | ||
|
||
includes = [ | ||
"*.rs", | ||
] | ||
|
||
[properties] | ||
inceptionYear = 2023 | ||
copyrightOwner = "The CopyrightOwner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2022-2023 The Authors. Licensed under Apache-2.0. | ||
|
||
//! Load balancer | ||
|
||
use macros::define_result; |
17 changes: 17 additions & 0 deletions
17
hawkeye-core/src/test/data/issue-110/main.rs.formatted.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2023 The CopyrightOwner | ||
// | ||
// 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. | ||
|
||
//! Load balancer | ||
|
||
use macros::define_result; |
36 changes: 36 additions & 0 deletions
36
hawkeye-core/src/test/java/io/korandoru/hawkeye/core/RegressionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2023 Korandoru Contributors | ||
* | ||
* 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. | ||
*/ | ||
|
||
package io.korandoru.hawkeye.core; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import io.korandoru.hawkeye.core.config.HawkEyeConfig; | ||
import java.io.File; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class RegressionTest { | ||
@Test | ||
void testIssue110() { | ||
final File file = new File("src/test/data/issue-110/licenserc.toml"); | ||
final HawkEyeConfig config = HawkEyeConfig.of(file).dryRun(true).build(); | ||
final LicenseFormatter formatter = new LicenseFormatter(config); | ||
formatter.call(); | ||
|
||
final File expected = new File("src/test/data/issue-110/main.rs.formatted.expected"); | ||
final File actual = new File("src/test/data/issue-110/main.rs.formatted"); | ||
assertThat(actual).hasSameTextualContentAs(expected); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters