Skip to content

Commit 6375a07

Browse files
committed
Include editorconfig-checker to complement editorconfig-gradle-plugin.
`editorconfig-gradle-plugin` doesn't have sufficient support for `.editorconfig` properties: https://github.com/ec4j/editorconfig-gradle-plugin#how-it-works `editorconfig-checker` has been added in version 2.4.0 for linux amd64: https://github.com/editorconfig-checker/editorconfig-checker/releases/tag/2.4.0 See also metafacture/metafacture-fix#179.
1 parent e8fea3f commit 6375a07

File tree

27 files changed

+451
-456
lines changed

27 files changed

+451
-456
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ trim_trailing_whitespace = true
2828
end_of_line = crlf
2929
trim_trailing_whitespace = false
3030

31-
[*.{gradle,yml}]
31+
[*.{g,gradle,json,xml,xsd,yml}]
3232
indent_size = 2
3333

3434
[metafacture-io/src/test/resources/org/metafacture/io/compressed.txt]

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ tmp
3232
.classpath
3333
.project
3434
.settings/
35-
bin/
3635

3736
# Ignore IntelliJ project files:
3837
*.ipr

CONTRIBUTING.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -180,43 +180,43 @@ We use semantic versioning in release numbers `A`.`B`.`C`, i.e. increase `A` whe
180180
The following commands trigger a release build.
181181

182182
1. Create a signed tag:
183-
```
184-
git tag -s metafacture-core-A.B.C
185-
```
183+
```
184+
git tag -s metafacture-core-A.B.C
185+
```
186186
1. When prompted, add a sensible commit message. For instance, something like:
187-
```
188-
Publish first release of the Metafacture A line
189-
```
187+
```
188+
Publish first release of the Metafacture A line
189+
```
190190
1. You can now test the build locally by invoking:
191-
```
192-
./gradlew assemble
193-
```
191+
```
192+
./gradlew assemble
193+
```
194194
1. Finally, push the new tag to GitHub to trigger the actual release build:
195-
```
196-
git push --follow-tags metafacture-core-A.B.C
197-
```
195+
```
196+
git push --follow-tags metafacture-core-A.B.C
197+
```
198198
199199
#### Publish to Maven Central
200200
201201
Upload archives to sonatype (where they can be released to Maven Central)
202202
203203
1. Make sure to have a clean directory (otherwise only a SNAPSHOT will be built):
204-
```
205-
git status
206-
```
204+
```
205+
git status
206+
```
207207
1. You need a `gradle.properties` in the root directory that looks like this:
208-
```
209-
signing.gnupg.executable=gpg
210-
signing.gnupg.useLegacyGpg=true
211-
signing.gnupg.homeDir=$e.g."~/.gnupg"
212-
signing.gnupg.keyName=$yourKeyName
213-
signing.gnupg.passphrase=$keysPassphrase
214-
releaseRepositoryUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/
215-
releaseRepositoryUser=$yourSonatypeUsername
216-
releaseRepositoryPassword=$yourSonatypePassword
217-
```
208+
```
209+
signing.gnupg.executable=gpg
210+
signing.gnupg.useLegacyGpg=true
211+
signing.gnupg.homeDir=$e.g."~/.gnupg"
212+
signing.gnupg.keyName=$yourKeyName
213+
signing.gnupg.passphrase=$keysPassphrase
214+
releaseRepositoryUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/
215+
releaseRepositoryUser=$yourSonatypeUsername
216+
releaseRepositoryPassword=$yourSonatypePassword
217+
```
218218
1. Let the release be built, signed and uploaded:
219-
```
220-
./gradlew publishAllPublicationsToMavenRepository
221-
```
219+
```
220+
./gradlew publishAllPublicationsToMavenRepository
221+
```
222222
1. Finally, go to oss.sonatype.org , check the `Staging Repositories` when it's finished, and release it by clicking `close`

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ If you are only interested in running Flux scripts without doing any Java progra
2121
1. Download the latest distribution package from the [release page](https://github.com/metafacture/metafacture-core/releases). Make sure that you do download a distribution package and *not* a source code package (the file name should include `*-dist*`).
2222

2323
2. Extract the downloaded archive:
24-
```bash
25-
$ tar xzf metafacture-core-$VERSION-dist.tar.gz
26-
```
27-
This will create a new directory containing a ready-to-use Metafacture distribution.
24+
```bash
25+
$ tar xzf metafacture-core-$VERSION-dist.tar.gz
26+
```
27+
This will create a new directory containing a ready-to-use Metafacture distribution.
2828
3. Change into the newly created directory:
29-
```bash
30-
$ cd metafacture-core-$VERSION
31-
```
29+
```bash
30+
$ cd metafacture-core-$VERSION
31+
```
3232
4. Run one of the example scripts:
33-
```bash
34-
$ ./flux.sh examples/read/marc21/read-marc21.flux
35-
```
36-
This example will print a number of MARC 21 records on standard output.
33+
```bash
34+
$ ./flux.sh examples/read/marc21/read-marc21.flux
35+
```
36+
This example will print a number of MARC 21 records on standard output.
3737

3838
The `examples` folder contains many more examples which provide a good starting point for learning Metafacture. If you have any questions please join our [mailing list](http://lists.dnb.de/mailman/listinfo/metafacture) or use our issue-based discussion forum over at [metafacture-documentation](https://github.com/metafacture/metafacture-documentation).
3939

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ editorconfig {
6868
]
6969
}
7070

71+
task editorconfigChecker(type: Exec, group: 'Verification') {
72+
executable 'misc/bin/editorconfig-checker'
73+
args('-exclude', '/\\.|/bin/|\\.beacon$|\\.txt\\.|^LICENSE$|^\\.project$|^gradlew.*')
74+
}
75+
7176
subprojects {
7277
apply plugin: 'signing'
7378
apply plugin: 'jacoco'
7479
apply plugin: 'checkstyle'
7580
apply plugin: 'maven-publish'
7681

82+
editorconfigCheck.dependsOn(editorconfigChecker)
7783
check.dependsOn(editorconfigCheck)
7884
check.dependsOn(javadoc)
7985

metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ private void emitAsSingleMultiscriptFields(final Map<?, BufferedField> fields) {
226226

227227
private String mapScriptToEntityName(final String script) {
228228
return LATIN_SCRIPT.equals(script) ? ENTITY_NAME_FOR_LATIN :
229-
(ARABIC_SCRIPT.equals(script) || HEBREW_SCRIPT.equals(script)) ? ENTITY_NAME_FOR_NON_LATIN_RL :
230-
ENTITY_NAME_FOR_NON_LATIN_LR;
229+
(ARABIC_SCRIPT.equals(script) || HEBREW_SCRIPT.equals(script)) ? ENTITY_NAME_FOR_NON_LATIN_RL : ENTITY_NAME_FOR_NON_LATIN_LR;
231230
}
232231

233232
private static class BufferedField {

metafacture-csv/src/main/java/org/metafacture/csv/CsvEncoder.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ public void setNoQuotes(final boolean noQuotes) {
138138
private void initialize() {
139139
writer = new StringWriter();
140140
final String emptyLineEnd = "";
141-
csvWriter = new CSVWriter(writer, separator,
142-
noQuotes ? CSVWriter.NO_QUOTE_CHARACTER : CSVWriter.DEFAULT_QUOTE_CHARACTER,
143-
CSVWriter.DEFAULT_ESCAPE_CHARACTER, emptyLineEnd);
141+
csvWriter = new CSVWriter(writer, separator, noQuotes ? CSVWriter.NO_QUOTE_CHARACTER : CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER, emptyLineEnd);
144142
}
145143

146144
private String[] arrayOf(final List<String> list) {

metafacture-flowcontrol/src/test/java/org/metafacture/flowcontrol/ObjectThreaderTest.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,39 @@
3939
*/
4040
public final class ObjectThreaderTest {
4141

42-
@Mock
43-
private ObjectReceiver<String> receiverThread1;
44-
@Mock
45-
private ObjectReceiver<String> receiverThread2;
42+
@Mock
43+
private ObjectReceiver<String> receiverThread1;
44+
@Mock
45+
private ObjectReceiver<String> receiverThread2;
4646

47-
private final ObjectThreader<String> objectThreader = new ObjectThreader<>();
48-
private static final int ACTIVE_THREADS_AT_BEGINNING = Thread.getAllStackTraces().keySet().size();
47+
private final ObjectThreader<String> objectThreader = new ObjectThreader<>();
48+
private static final int ACTIVE_THREADS_AT_BEGINNING = Thread.getAllStackTraces().keySet().size();
4949

50-
@Before
51-
public void setup() {
52-
MockitoAnnotations.initMocks(this);
53-
objectThreader//
54-
.addReceiver(receiverThread1)//
55-
.addReceiver(receiverThread2);
56-
}
50+
@Before
51+
public void setup() {
52+
MockitoAnnotations.initMocks(this);
53+
objectThreader//
54+
.addReceiver(receiverThread1)//
55+
.addReceiver(receiverThread2);
56+
}
5757

58-
@Test
59-
public void shouldSplitAllObjectsToAllThreadedDownStreamReceivers() throws InterruptedException {
60-
objectThreader.process("a");
61-
objectThreader.process("b");
62-
objectThreader.process("a");
63-
objectThreader.process("c");
64-
// check if two more threads were indeed created
65-
assertThat(Thread.getAllStackTraces().keySet().size() - ACTIVE_THREADS_AT_BEGINNING).isEqualTo(2);
66-
objectThreader.closeStream();
67-
// verify thread 1
68-
verify(receiverThread1, atLeast(2)).process("a");
69-
verify(receiverThread1, atMost(0)).process("b");
70-
verify(receiverThread1, atMost(0)).process("c");
71-
// verify thread 2
72-
verify(receiverThread2, atMost(0)).process("a");
73-
verify(receiverThread2, atLeast(1)).process("b");
74-
verify(receiverThread2, atLeast(1)).process("c");
75-
}
58+
@Test
59+
public void shouldSplitAllObjectsToAllThreadedDownStreamReceivers() throws InterruptedException {
60+
objectThreader.process("a");
61+
objectThreader.process("b");
62+
objectThreader.process("a");
63+
objectThreader.process("c");
64+
// check if two more threads were indeed created
65+
assertThat(Thread.getAllStackTraces().keySet().size() - ACTIVE_THREADS_AT_BEGINNING).isEqualTo(2);
66+
objectThreader.closeStream();
67+
// verify thread 1
68+
verify(receiverThread1, atLeast(2)).process("a");
69+
verify(receiverThread1, atMost(0)).process("b");
70+
verify(receiverThread1, atMost(0)).process("c");
71+
// verify thread 2
72+
verify(receiverThread2, atMost(0)).process("a");
73+
verify(receiverThread2, atLeast(1)).process("b");
74+
verify(receiverThread2, atLeast(1)).process("c");
75+
}
7676

7777
}

0 commit comments

Comments
 (0)