Skip to content

Commit

Permalink
Merge pull request #388 from metafacture/updateAndApplyEditorConfig
Browse files Browse the repository at this point in the history
Update and apply EditorConfig file.
  • Loading branch information
blackwinter authored Sep 6, 2021
2 parents aed6de7 + 575ee3c commit 57fd430
Show file tree
Hide file tree
Showing 60 changed files with 326 additions and 319 deletions.
32 changes: 15 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*).
Expand Down
15 changes: 15 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void setXmlEncoding(String xmlEncoding) {

/**
* Formats the resulting xml, by indentation.
*
*
* @param formatted
* True, if formatting is activated.
*/
Expand Down Expand Up @@ -257,4 +257,4 @@ private void sendAndClearData() {
getReceiver().process(builder.toString());
builder.delete(0, builder.length());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ public static PicaConstants from(boolean isNormalized, char ch) {
}
return NO_MARKER;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -33,12 +33,12 @@
* receivers are coupled with an
* {@link org.metafacture.flowcontrol.ObjectPipeDecoupler}, so each added
* receiver runs in its own thread.
*
*
* @param <T> Object type
*
* @author Pascal Christoph (dr0i)
* @author Fabian Steeg (fsteeg)
*
*
*/
@In(Object.class)
@Out(Object.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

/**
* Decode HTML to metadata events. Each input document represents one record.
*
*
* @author Fabian Steeg (fsteeg)
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class ElementExtractorTest {
private static final StringReader IN = new StringReader("<html>"
+ "<script data-test='site-head-data'>{\"code\":\"hey\"}</script>"
+ "<script data-test='model-linked-data'>{\"code\":\"yo\"}");

private static final String OUT = "{\"code\":\"yo\"}";

private ElementExtractor elementExtractor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#
encode-json org.metafacture.json.JsonEncoder
decode-json org.metafacture.json.JsonDecoder
decode-json org.metafacture.json.JsonDecoder
12 changes: 6 additions & 6 deletions metafacture-runner/src/main/dist/config/jndi/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Place your JNDI properties files in this directory. By default
metafacture-runner uses [simpleJNDI](http://code.google.com/p/osjava/wiki/SimpleJNDI)
Place your JNDI properties files in this directory. By default
metafacture-runner uses [simpleJNDI](http://code.google.com/p/osjava/wiki/SimpleJNDI)
as JNDI provider.

# Examples

One of the most common use cases of JNDI is to provide data sources for
JDBC. However, JNDI can be used to pass other variables into a program
as well. The following to examples demonstrate how to define data sources
and other values.
and other values.

More elaborate examples can be found in the simpleJDNI documentation which
is part of the [binary download package](http://code.google.com/p/osjava/downloads/detail?name=simple-jndi-0.11.4.1.zip&can=2&q=)
of simpleJNDI.

## Data sources

To register a data source with the name `MySqlDB`, create a property
To register a data source with the name `MySqlDB`, create a property
file named `MySqlDB.properties` with the following contents:

```
Expand All @@ -36,5 +36,5 @@ enabled = true
enabled.type = java.lang.Boolean
```

If this file is saved as `debug.properties`, the value of enabled can
be accessed as follows: `debug.enabled`.
If this file is saved as `debug.properties`, the value of enabled can
be accessed as follows: `debug.enabled`.
2 changes: 1 addition & 1 deletion metafacture-runner/src/main/dist/config/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<appender-ref ref="stdout" />
</root>

</log4j:configuration>
</log4j:configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ stream-to-triples|
sort-triples(by="subject")|
collect-triples|
encode-formeta(style="multiline")|
write("stdout");
write("stdout");
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ fileName|
open-file(encoding="UTF-8")|
read-beacon(metadatafilter="name|isil")|
encode-formeta(style="multiline")|
write("stdout");
write("stdout");
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<regexp match="$[type]"/>
</postprocess>
</choose>

</combine>

</rules>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#BLA BLA
#BLA BLA
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ morph(FLUX_DIR + "gnd-type.xml")|
stream-to-triples|
count-triples(countBy="object")|
template("${s}\t${o}")|
write("stdout");
write("stdout");
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<substring start="1" end="2" />
</data>



</rules>

<maps>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ as-lines|
decode-pica|
filter(FLUX_DIR + "filter-morph.xml")|
encode-formeta(style="verbose")|
write("stdout");
write("stdout");
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@

<entity name="gnd">
<data source="@name" name="name"/>

<data source="002@.0" name="satzart">
<substring end="2" />
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ file|
open-file|
//"1025374754"|
//id|
//template("https://portal.dnb.de/opac.htm?method=requestMarcXml&idn=${o}")|
//template("https://portal.dnb.de/opac.htm?method=requestMarcXml&idn=${o}")|
//open-http|
decode-xml|
handle-marcxml|
Expand Down
Loading

0 comments on commit 57fd430

Please sign in to comment.