Skip to content

Commit

Permalink
[Spotless] Applying Google Code Format for core/src/main files #4 (op…
Browse files Browse the repository at this point in the history
…ensearch-project#1933)

* GJF part 4

Signed-off-by: Mitchell Gale <[email protected]>

* add build.gradle comment to mention why we are ignoring checkstyle failures for core.

Signed-off-by: Mitchell Gale <[email protected]>

* Fix include spotless build gradle.

Signed-off-by: Mitchell Gale <[email protected]>

* revert astDSL.JAVA

Signed-off-by: Mitchell Gale <[email protected]>

* revert ast changes as was covered in spotless #1 PR for GJF.

Signed-off-by: Mitchell Gale <[email protected]>

* Reverting commits in ast folder attempt #2

Signed-off-by: Mitchell Gale <[email protected]>

* revert change to RaretopN.java

Signed-off-by: Mitchell Gale <[email protected]>

* addressed PR comments.

Signed-off-by: Mitchell Gale <[email protected]>

* Replacing removed include in spotless.

Signed-off-by: Mitchell Gale <[email protected]>

---------

Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
  • Loading branch information
MitchellGale committed Aug 18, 2023
1 parent d9a78df commit 7cf5ca3
Show file tree
Hide file tree
Showing 17 changed files with 1,256 additions and 1,326 deletions.
36 changes: 28 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,32 @@ repositories {
spotless {
java {
target fileTree('.') {
include '**/*.java'
include 'core/src/main/java/org/opensearch/sql/DataSourceSchemaName.java',
'core/src/test/java/org/opensearch/sql/data/**/*.java',
'core/src/test/java/org/opensearch/sql/config/**/*.java',
'core/src/test/java/org/opensearch/sql/analysis/**/*.java',
'core/src/main/java/org/opensearch/sql/planner/**/*.java',
'core/src/main/java/org/opensearch/sql/storage/**/*.java',
'core/src/main/java/org/opensearch/sql/utils/**/*.java',
'core/src/main/java/org/opensearch/sql/monitor/**/*.java',
'core/src/main/java/org/opensearch/sql/expression/**/*.java',
'core/src/main/java/org/opensearch/sql/executor/**/*.java',
'core/src/main/java/org/opensearch/sql/exception/**/*.java',
'core/src/main/java/org/opensearch/sql/analysis/**/*.java',
'core/src/test/java/org/opensearch/sql/data/**/*.java',
'core/src/test/java/org/opensearch/sql/datasource/**/*.java',
'core/src/test/java/org/opensearch/sql/ast/**/*.java'
exclude '**/build/**', '**/build-*/**'
}
// importOrder()
importOrder()
// licenseHeader("/*\n" +
// " * Copyright OpenSearch Contributors\n" +
// " * SPDX-License-Identifier: Apache-2.0\n" +
// " */\n\n")
// removeUnusedImports()
// trimTrailingWhitespace()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
// googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
}
}

Expand All @@ -113,9 +127,8 @@ allprojects {
sourceCompatibility = targetCompatibility = "11"
}
configurations.all {
resolutionStrategy.force "com.squareup.okio:okio:3.5.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib:1.9.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib:1.6.0"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0"
}
}

Expand Down Expand Up @@ -217,5 +230,12 @@ task updateVersion {
println "Setting version to ${newVersion}."
// String tokenization to support -SNAPSHOT
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
ant.replaceregexp(match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true) {
fileset(dir: projectDir) {
include(name: "workbench/package.json")
include(name: "workbench/opensearch_dashboards.json")
}
}
ant.replaceregexp(file:'workbench/opensearch_dashboards.json', match:'"opensearchDashboardsVersion": "\\d+.\\d+.\\d+', replace:'"opensearchDashboardsVersion": ' + '"' + newVersion.tokenize('-')[0], flags:'g', byline:true)
}
}
15 changes: 15 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ plugins {
id 'java-library'
id "io.freefair.lombok"
id 'jacoco'
id 'info.solidsoft.pitest' version '1.9.0'
id 'java-test-fixtures'
}

repositories {
mavenCentral()
}

// Being ignored as a temporary measure before being removed in favour of
// spotless https://github.com/opensearch-project/sql/issues/1101
checkstyleTest.ignoreFailures = true
checkstyleMain.ignoreFailures = true

pitest {
targetClasses = ['org.opensearch.sql.*']
pitestVersion = '1.9.0'
threads = 4
outputFormats = ['HTML', 'XML']
timestampedReports = false
junit5PluginVersion = '1.0.0'
}

dependencies {
api group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ public class DataSourceSchemaName {
private final String dataSourceName;

private final String schemaName;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/


package org.opensearch.sql.analysis;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Loading

0 comments on commit 7cf5ca3

Please sign in to comment.