diff --git a/.editorconfig b/.editorconfig index 507e5f7b5..238988221 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,27 +14,25 @@ # limitations under the License. # -root=true +root = true [*] -charset=utf-8 -end_of_line=lf -insert_final_newline=true -trim_trailing_whitespace=true -indent_style=space -indent_size=4 -continuation_indent_size=8 +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true -[{*.yml,*.yaml}] -indent_style=space -indent_size=2 +[*.bat] +end_of_line = crlf +trim_trailing_whitespace = false -[*.gradle] -indent_style=space -indent_size=2 +[*.{gradle,yml}] +indent_size = 2 -[*.bat] -end_of_line=crlf +[metafacture-io/src/test/resources/org/metafacture/io/compressed.txt] +insert_final_newline = false [metafacture-runner/src/main/dist/config/java-options.conf] -end_of_line=crlf +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes index 484ce04f8..6866584b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -28,7 +28,7 @@ *.js text *.fom text -# Platform-specific scripts should always use +# Platform-specific scripts should always use # their native end-of-line markers: *.bat text eol=crlf *.sh text eol=lf diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 043ad4692..3122987cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Explain the problem and include additional details to help maintainers reproduce the problem: * **Use a clear and descriptive title** for the issue to identify the problem. -* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you are running Metafacture (e.g. running flux.sh/flux.bat or as a Java library). When listing steps, **don't just say what you did, but explain how you did it**. For example, if you're describing the behavior of a specific Morph/Fix function, provide the actual workflow (Flux/Java) and the full Morph file you're using (see also next point). +* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you are running Metafacture (e.g. running flux.sh/flux.bat or as a Java library). When listing steps, **don't just say what you did, but explain how you did it**. For example, if you're describing the behavior of a specific Morph/Fix function, provide the actual workflow (Flux/Java) and the full Morph file you're using (see also next point). * **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code). The ideal example would be a stripped-down runnable use case using some sample data showing the problematic behavior. * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. * **Explain which behavior you expected to see instead and why.** diff --git a/README.md b/README.md index c81d9d638..24fbb9a6f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Originally, Metafacture was developed as part of the [Culturegraph](http://cultu You can either use Metafacture as a stand-alone application or include it as a Java library in your own projects. ## Metafacture as a stand-alone application - + If you are only interested in running Flux scripts without doing any Java programming this is the way to go. The instructions assume that you are using a *nix-like shell. 1. Download the latest distribution package from the [metafacture-core/releases](https://github.com/metafacture/metafacture-core/releases) page. Make sure that you do download a distribution package and _not_ a source code package (the file name should include *-dist*). diff --git a/build.gradle b/build.gradle index 19fb6afe4..1b552802c 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,7 @@ import java.util.regex.Matcher plugins { id 'org.ajoberstar.grgit' version '2.3.0' + id 'org.ec4j.editorconfig' version '0.0.3' id 'org.sonarqube' version '2.6.2' id 'io.codearte.nexus-staging' version '0.11.0' } @@ -38,11 +39,25 @@ project(':metafacture-runner') { apply plugin: 'java' } +editorconfig { + excludes = [ + '**/*.beacon', + '**/*.bgzf', + '**/*.bz2', + '**/*.bzip2', + '**/*.gzip', + '**/*.xz', + 'gradlew*' + ] +} + subprojects { apply plugin: 'signing' apply plugin: 'maven' apply plugin: 'jacoco' + check.dependsOn(editorconfigCheck) + sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java index cfec369c2..3c7110bae 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java @@ -24,9 +24,9 @@ /** * Opens an OAI-PMH stream and passes a reader to the receiver. - * + * * @author Pascal Christoph (dr0i) - * + * */ @Description("Opens an OAI-PMH stream and passes a reader to the receiver. Mandatory arguments are: BASE_URL, DATE_FROM, DATE_UNTIL, METADATA_PREFIX, SET_SPEC .") @In(String.class) @@ -55,7 +55,7 @@ public OaiPmhOpener() { /** * Sets the encoding to use. The default setting is UTF-8. - * + * * @param encoding new default encoding */ public void setEncoding(final String encoding) { @@ -65,7 +65,7 @@ public void setEncoding(final String encoding) { /** * Sets the beginning of the retrieving of updated data. The form is * YYYY-MM-DD . - * + * * @param dateFrom The form is YYYY-MM-DD . */ public void setDateFrom(final String dateFrom) { @@ -74,7 +74,7 @@ public void setDateFrom(final String dateFrom) { /** * Sets the end of the retrieving of updated data. The form is YYYY-MM-DD . - * + * * @param dateUntil The form is YYYY-MM-DD . */ public void setDateUntil(final String dateUntil) { @@ -83,7 +83,7 @@ public void setDateUntil(final String dateUntil) { /** * Sets the OAI-PM metadata prefix . - * + * * @param metadataPrefix the OAI-PM metadata prefix */ public void setMetadataPrefix(final String metadataPrefix) { @@ -92,7 +92,7 @@ public void setMetadataPrefix(final String metadataPrefix) { /** * Sets the OAI-PM set specification . - * + * * @param setSpec th OAI-PM set specification */ public void setSetSpec(final String setSpec) { diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index bb81741d5..84b4d8aa6 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -102,7 +102,7 @@ public void setXmlEncoding(String xmlEncoding) { /** * Formats the resulting xml, by indentation. - * + * * @param formatted * True, if formatting is activated. */ @@ -257,4 +257,4 @@ private void sendAndClearData() { getReceiver().process(builder.toString()); builder.delete(0, builder.length()); } -} \ No newline at end of file +} diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaConstants.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaConstants.java index c549fb4a3..92ffd2a7e 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaConstants.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaConstants.java @@ -53,4 +53,4 @@ public static PicaConstants from(boolean isNormalized, char ch) { } return NO_MARKER; } -} \ No newline at end of file +} diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java index 1b8ffb270..1d20ba63e 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java @@ -104,7 +104,7 @@ public static String escape(final String unescaped, final boolean escapeUnicode) .mapToObj(value -> escapeCodePoint(value, escapeUnicode)) .collect(joining()); } - + private static String escapeCodePoint(final int codePoint, final boolean escapeUnicode) { final String entity = entityFor(codePoint); if (entity != null) { diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java index 903ce5aba..6b1f7ad1d 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java @@ -1,5 +1,5 @@ /* Copyright 2019 Pascal Christoph (hbz), and others. - * + * * 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 @@ -33,12 +33,12 @@ * receivers are coupled with an * {@link org.metafacture.flowcontrol.ObjectPipeDecoupler}, so each added * receiver runs in its own thread. - * + * * @param Object type * * @author Pascal Christoph (dr0i) * @author Fabian Steeg (fsteeg) - * + * */ @In(Object.class) @Out(Object.class) diff --git a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java index ed5d2cc51..0f285c68c 100644 --- a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java +++ b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java @@ -41,7 +41,7 @@ /** * Decode HTML to metadata events. Each input document represents one record. - * + * * @author Fabian Steeg (fsteeg) * */ diff --git a/metafacture-html/src/test/java/org/metafacture/html/ElementExtractorTest.java b/metafacture-html/src/test/java/org/metafacture/html/ElementExtractorTest.java index 860af9f34..abf8d0293 100644 --- a/metafacture-html/src/test/java/org/metafacture/html/ElementExtractorTest.java +++ b/metafacture-html/src/test/java/org/metafacture/html/ElementExtractorTest.java @@ -38,7 +38,7 @@ public final class ElementExtractorTest { private static final StringReader IN = new StringReader("" + "" + "