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

Fix end of file markers in all files and adjust 14 tests that did not expect it #902

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@
</module>
<module name="SingleLineJavadoc"/>
</module>
</module>
</module>
2 changes: 1 addition & 1 deletion .config/style.intellij-idea.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</code_scheme>
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ license-maven-plugin/src/test/resources/unknown/header.txt text eol=crlf
license-maven-plugin/src/test/resources/update/doc1.txt text eol=crlf
license-maven-plugin/src/test/resources/update/doc2.txt text eol=crlf
license-maven-plugin/src/test/resources/update/issue48/test1.php text eol=crlf
license-maven-plugin/src/test/resources/update/issue48/test2.php text eol=crlf
license-maven-plugin/src/test/resources/update/issue48/test2.php text eol=crlf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.mycila.maven.plugin.license.fs.CopyrightRangeProvider
com.mycila.maven.plugin.license.fs.CopyrightRangeProvider
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,4 @@ private String getAuthorEmailFromCommit(RevCommit commit) {
public void close() {
repository.close();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
com.mycila.maven.plugin.license.git.CopyrightRangeProvider
com.mycila.maven.plugin.license.git.CopyrightAuthorProvider
com.mycila.maven.plugin.license.git.CopyrightAuthorProvider
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,4 @@ private void assertCreation(GitLookup provider, String relativePath, int expecte
Assertions.assertEquals(expected, actual);
}

}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.mycila.maven.plugin.license.svn.SVNPropertiesProvider
com.mycila.maven.plugin.license.svn.SVNPropertiesProvider
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=license:format
invoker.goals=license:format
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 1st
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 2nd
mock license
mock license
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ for (final String filename : ALL_FILES) {
Files.copy(unformattedJavaFile, unformattedJavaFile.resolveSibling(filename + ".bak"))
}

return true;
return true;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=license:format
invoker.goals=license:format
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/legacy-config/mock-license.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is a
mock license
mock license
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/legacy-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
</plugins>
</build>

</project>
</project>
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/legacy-config/setup.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if (!Files.exists(unformattedJavaFile)) {

Files.copy(unformattedJavaFile, unformattedJavaFile.resolveSibling("Unformatted1.java.bak"))

return true;
return true;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=license:format
invoker.goals=license:format
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 1st
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 2nd
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 3rd
mock license
mock license
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/multi-license/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
</plugins>
</build>

</project>
</project>
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/multi-license/setup.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if (!Files.exists(unformattedJavaFile)) {

Files.copy(unformattedJavaFile, unformattedJavaFile.resolveSibling("Unformatted1.java.bak"))

return true;
return true;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=license:format
invoker.goals=license:format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=license:format
invoker.goals=license:format
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is a
mock license
mock license
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/single-licence-set/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if (!Files.exists(unformattedJavaFile)) {

Files.copy(unformattedJavaFile, unformattedJavaFile.resolveSibling("Unformatted1.java.bak"))

return true;
return true;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 1st
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 2nd
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 3rd
mock license
mock license
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=license:format
invoker.goals=license:format
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 1st
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 2nd
mock license
mock license
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This is the 3rd
mock license
mock license
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/tri-license-set/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
</plugins>
</build>

</project>
</project>
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/tri-license-set/setup.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ for (final String filename : ALL_FILES) {
Files.copy(unformattedJavaFile, unformattedJavaFile.resolveSibling(filename + ".bak"))
}

return true;
return true;
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ protected AbstractLicensePolicyEnforcer(final LicensePolicy policy) {
public LicensePolicy getPolicy() {
return policy;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public class DefaultLicensePolicyEnforcer extends ArtifactLicensePolicyEnforcer
public DefaultLicensePolicyEnforcer() {
super(new LicensePolicy(LicensePolicy.Rule.DENY, LicensePolicy.Type.ARTIFACT_PATTERN, "*"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public interface LicenseMessage {
String WARN_POLICY_DENIED = "Some licenses were denied by policy:";
String INFO_LICENSE_IMPL = "Checking licenses in dependencies using";
String INFO_DEPS_DISCOVERED = "Discovered dependencies after filtering";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public boolean apply(final License target) {
public Class<?> getType() {
return License.class;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public interface LicensePolicyEnforcer<T> {
public boolean apply(final T target);

public Class<?> getType();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ public License getLicense() {
public String toString() {
return String.format("%s [%s] %s", getArtifact(), getLicense().getName(), getPolicy());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public boolean apply(final License target) {
public Class<?> getType() {
return License.class;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>
For more information, please refer to <http://unlicense.org>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © ${year} ${owner} <${email}>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ void test_remove_xml_txt() throws Exception {
remove.project = new MavenProjectStub();
remove.execute();

Assertions.assertEquals(FileUtils.read(new File(tmp, "doc9.xml"), Charset.defaultCharset()), "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n" +
Assertions.assertEquals("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n" +
"\r\n" +
"\r\n" +
"\r\n" +
"<web-app>\r\n" +
"\r\n" +
"</web-app>\r\n");
"</web-app>\r\n", FileUtils.read(new File(tmp, "doc9.xml"), Charset.defaultCharset()));
Assertions.assertEquals("some data\r\nand other data\r\n", FileUtils.read(new File(tmp, "doc3.txt"), Charset.defaultCharset()));
}

Expand All @@ -83,9 +83,9 @@ void test_remove_script_style() throws Exception {
remove.project = new MavenProjectStub();
remove.execute();

Assertions.assertEquals(FileUtils.read(new File(tmp, "issue44.rb"), Charset.defaultCharset()), "ruby code here" + LS + "and other data" + LS + "");
Assertions.assertEquals(FileUtils.read(new File(tmp, "issue44-2.rb"), Charset.defaultCharset()), "# code comment" + LS + "ruby code here" + LS + "and other data" + LS + "");
Assertions.assertEquals(FileUtils.read(new File(tmp, "issue44-3.rb"), Charset.defaultCharset()), "# code comment" + LS + "ruby code here" + LS + "and other data" + LS + "");
Assertions.assertEquals("ruby code here" + LS + "and other data" + LS + "", FileUtils.read(new File(tmp, "issue44.rb"), Charset.defaultCharset()));
Assertions.assertEquals("# code comment" + LS + "ruby code here" + LS + "and other data" + LS + "", FileUtils.read(new File(tmp, "issue44-2.rb"), Charset.defaultCharset()));
Assertions.assertEquals("# code comment" + LS + "ruby code here" + LS + "and other data" + LS + "", FileUtils.read(new File(tmp, "issue44-3.rb"), Charset.defaultCharset()));
}

@Test
Expand All @@ -100,9 +100,9 @@ void test_remove_multiline() throws Exception {
remove.project = new MavenProjectStub();
remove.execute();

Assertions.assertEquals(FileUtils.read(new File(tmp, "test.xml"), Charset.defaultCharset()), "<assembly>" + LS + "" +
Assertions.assertEquals("<assembly>" + LS + "" +
" <id>project</id>" + LS + "" +
"</assembly>" + LS + "");
"</assembly>" + LS + "", FileUtils.read(new File(tmp, "test.xml"), Charset.defaultCharset()));
}

@Test
Expand All @@ -117,11 +117,11 @@ void test_js_1() throws Exception {
remove.project = new MavenProjectStub();
remove.execute();

Assertions.assertEquals(FileUtils.read(new File(tmp, "test1.js"), Charset.defaultCharset()), "/**" + LS + "" +
Assertions.assertEquals("/**" + LS + "" +
" * jrunscript JavaScript built-in functions and objects." + LS + "" +
" */" + LS + "" +
"" + LS + "" +
"function a(){}");
"function a(){}", FileUtils.read(new File(tmp, "test1.js"), Charset.defaultCharset()).trim());
}

@Test
Expand All @@ -136,11 +136,11 @@ void test_js_2() throws Exception {
remove.project = new MavenProjectStub();
remove.execute();

Assertions.assertEquals(FileUtils.read(new File(tmp, "test2.js"), Charset.defaultCharset()), "/**" + LS + "" +
Assertions.assertEquals("/**" + LS + "" +
" * jrunscript JavaScript built-in functions and objects." + LS + "" +
" */" + LS + "" +
"" + LS + "" +
"function a(){}");
"function a(){}", FileUtils.read(new File(tmp, "test2.js"), Charset.defaultCharset()).trim());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void test_check_json() throws Exception {
}

String processed = unixify(FileUtils.read(plugin.reportLocation, Charset.defaultCharset()));
String expected = FileUtils.read(new File("src/test/resources/issues/issue-122/check.json"), Charset.defaultCharset());
String expected = FileUtils.read(new File("src/test/resources/issues/issue-122/check.json"), Charset.defaultCharset()).trim();
assertThat(processed).isEqualTo(expected);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ void test_format_json() throws Exception {
plugin.execute();

String processed = unixify(FileUtils.read(plugin.reportLocation, Charset.defaultCharset()));
String expected = FileUtils.read(new File("src/test/resources/issues/issue-122/format.json"), Charset.defaultCharset());
String expected = FileUtils.read(new File("src/test/resources/issues/issue-122/format.json"), Charset.defaultCharset()).trim();
assertThat(processed).isEqualTo(expected);
}

Expand Down Expand Up @@ -169,7 +169,7 @@ void test_remove_json() throws Exception {
plugin.execute();

String processed = unixify(FileUtils.read(plugin.reportLocation, Charset.defaultCharset()));
String expected = FileUtils.read(new File("src/test/resources/issues/issue-122/remove.json"), Charset.defaultCharset());
String expected = FileUtils.read(new File("src/test/resources/issues/issue-122/remove.json"), Charset.defaultCharset()).trim();
assertThat(processed).isEqualTo(expected);
}

Expand Down
Loading