Skip to content

Commit

Permalink
Update to better checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Aug 31, 2021
1 parent 54a3bb5 commit 82e66f6
Show file tree
Hide file tree
Showing 551 changed files with 708 additions and 641 deletions.
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jar {
'Bundle-DocURL': 'https://github.com/akarnokd/RxJavaExtensions')
}

checkstyle {
configFile = project.file("config/checkstyle/checkstyle.xml")
configProperties = [
"checkstyle.suppressions.file": project.file("config/checkstyle/suppressions.xml"),
"checkstyle.header.file" : project.file("config/license/HEADER_JAVA")
]
}

apply plugin: "com.vanniktech.maven.publish"

jmh {
Expand Down Expand Up @@ -90,7 +98,7 @@ test {
}

license {
header rootProject.file('HEADER')
header rootProject.file('config/license/HEADER')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures true
Expand Down
30 changes: 30 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
</module>

<!-- Headers -->
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"/>
<property name="fileExtensions" value="java"/>
</module>

<module name="TreeWalker">
<module name="JavadocMethod"/>
<module name="MissingJavadocMethod">
<property name="severity" value="warning"/>
</module>

<module name="RegexpSinglelineJava">
<property name="severity" value="warning"/>
<property name="format" value="^(?!\s+\* $).*?\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
</module>

</module>
13 changes: 13 additions & 0 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>

<suppress checks="MissingJavadocMethod" files="[\\/]main[\\/]java[\\/]hu[\\/]akarnokd[\\/]rxjava3[\\/]internal[\\/]"/>
<suppress checks="MissingJavadocMethod" files="[\\/]jmh[\\/]java[\\/]hu[\\/]akarnokd[\\/]rxjava3[\\/]"/>
<suppress checks="MissingJavadocMethod" files="[\\/]test[\\/]java[\\/]hu[\\/]akarnokd[\\/]rxjava3[\\/]"/>

</suppressions>
2 changes: 1 addition & 1 deletion HEADER → config/license/HEADER
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2016-${year} David Karnok
Copyright 2016-present David Karnok

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
15 changes: 15 additions & 0 deletions config/license/HEADER_JAVA
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2016-present David Karnok
*
* 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.
*/
69 changes: 0 additions & 69 deletions gradle/maven.gradle

This file was deleted.

5 changes: 4 additions & 1 deletion src/jmh/java/hu/akarnokd/rxjava3/ExamplePerf.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,6 +36,9 @@ public class ExamplePerf {
@Param({"1", "10", "100", "1000", "10000", "100000", "1000000"})
public int count;

/**
* Insert setup code here.
*/
@Setup
public void setup() {

Expand Down
5 changes: 4 additions & 1 deletion src/jmh/java/hu/akarnokd/rxjava3/FlatMapExPerf.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,6 +71,9 @@ public class FlatMapExPerf {

Flowable<Integer> asyncAsyncB;

/**
* Prepare fields.
*/
@Setup
public void setup() {
Integer[] array = new Integer[count];
Expand Down
6 changes: 5 additions & 1 deletion src/jmh/java/hu/akarnokd/rxjava3/PerfAsyncConsumer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -69,6 +69,10 @@ public void onComplete() {
countDown();
}

/**
* Wait either via spinning or sleeping.
* @param count how much value is expected to be received
*/
public void await(long count) {
if (count <= 1000) {
while (getCount() != 0) { }
Expand Down
2 changes: 1 addition & 1 deletion src/jmh/java/hu/akarnokd/rxjava3/PerfConsumer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hu/akarnokd/rxjava3/async/AnyValue.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hu/akarnokd/rxjava3/async/AsyncFlowable.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hu/akarnokd/rxjava3/async/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hu/akarnokd/rxjava3/basetypes/Nono.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hu/akarnokd/rxjava3/basetypes/NonoCache.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 David Karnok
* Copyright 2016-present David Karnok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 82e66f6

Please sign in to comment.