Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- '!sql-jdbc/**'
- '**gradle*'
- '**lombok*'
- '**checkstyle*'
- 'integ-test/**'
- '**/*.jar'
- '**/*.pom'
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/sql-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,16 @@ jobs:
- name: Run tests
id: tests
run: |
# checkstyle
./gradlew :opensearch:checkstyleMain || echo "* Checkstyle failed for opensearch/src" > report.log
./gradlew :opensearch:checkstyleTest || echo "* Checkstyle failed for opensearch/test" >> report.log
./gradlew :sql:checkstyleMain || echo "* Checkstyle failed for sql/src" >> report.log
./gradlew :sql:checkstyleTest || echo "* Checkstyle failed for sql/test" >> report.log
./gradlew :ppl:checkstyleMain || echo "* Checkstyle failed for ppl/src" >> report.log
./gradlew :ppl:checkstyleTest || echo "* Checkstyle failed for ppl/test" >> report.log
./gradlew :core:checkstyleMain || echo "* Checkstyle failed for core/src" >> report.log
./gradlew :core:checkstyleTest || echo "* Checkstyle failed for core/test" >> report.log
./gradlew :common:checkstyleMain || echo "* Checkstyle failed for common/src" >> report.log
./gradlew :common:checkstyleTest || echo "* Checkstyle failed for common/test" >> report.log
./gradlew :legacy:checkstyleMain || echo "* Checkstyle failed for legacy/src" >> report.log
./gradlew :legacy:checkstyleTest || echo "* Checkstyle failed for legacy/test" >> report.log
./gradlew :protocol:checkstyleMain || echo "* Checkstyle failed for protocol/src" >> report.log
./gradlew :protocol:checkstyleTest || echo "* Checkstyle failed for protocol/test" >> report.log
./gradlew :opensearch-sql-plugin:checkstyleMain || echo "* Checkstyle failed for plugin/src" >> report.log
./gradlew :opensearch-sql-plugin:checkstyleTest || echo "* Checkstyle failed for plugin/test" >> report.log
# Add checkstyle for `integ-test` when fixed
# Spotless
./gradlew :opensearch:spotlessCheck || echo "* Spotless failed for opensearch" > report.log
./gradlew :sql:spotlessCheck || echo "* Spotless failed for sql" >> report.log
./gradlew :ppl:spotlessCheck || echo "* Spotless failed for ppl" >> report.log
./gradlew :core:spotlessCheck || echo "* Spotless failed for core" >> report.log
./gradlew :common:spotlessCheck || echo "* Spotless failed for common" >> report.log
./gradlew :legacy:spotlessCheck || echo "* Spotless failed for legacy" >> report.log
./gradlew :protocol:spotlessCheck || echo "* Spotless failed for protocol" >> report.log
./gradlew :opensearch-sql-plugin:spotlessCheck || echo "* Spotless failed for plugin" >> report.log
./gradlew :integ-test:spotlessCheck || echo "* Spotless failed for integ-test" >> report.log
# Unit tests
./gradlew :opensearch:test || echo "* Unit tests failed for opensearch" >> report.log
./gradlew :ppl:test || echo "* Unit tests failed for sql" >> report.log
Expand Down
10 changes: 3 additions & 7 deletions DEVELOPER_GUIDE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ The plugin codebase is in standard layout of Gradle project::
├── THIRD-PARTY
├── build.gradle
├── config
│ └── checkstyle
├── docs
│   ├── attributions.md
│   ├── category.json
Expand Down Expand Up @@ -170,7 +169,6 @@ Here are sub-folders (Gradle modules) for plugin source code:
Here are other files and sub-folders that you are likely to touch:

- ``build.gradle``: Gradle build script.
- ``config``: only Checkstyle configuration files for now.
- ``docs``: documentation for developers and reference manual for users.
- ``doc-test``: code that run .rst docs in ``docs`` folder by Python doctest library.

Expand All @@ -189,15 +187,15 @@ Java files in the OpenSearch codebase are formatted with the Eclipse JDT formatt

The formatting check can be run explicitly with::

./gradlew spotlessJavaCheck
./gradlew spotlessCheck

The code can be formatted with::

./gradlew spotlessApply

These tasks can also be run for specific modules, e.g.::

./gradlew server:spotlessJavaCheck
./gradlew server:spotlessCheck

For more information on the spotless for the OpenSearch project please see `https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#java-language-formatting-guidelines <https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#java-language-formatting-guidelines>`_.

Expand Down Expand Up @@ -230,9 +228,7 @@ Most of the time you just need to run ./gradlew build which will make sure you p
* - ./gradlew generateGrammarSource
- (Re-)Generate ANTLR parser from grammar file.
* - ./gradlew compileJava
- Compile all Java source files.
* - ./gradlew checkstyle
- Run all checks according to Checkstyle configuration.
- Compile all Java source files.
* - ./gradlew test
- Run all unit tests.
* - ./gradlew :integ-test:integTest
Expand Down
30 changes: 1 addition & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ buildscript {
plugins {
id 'nebula.ospackage' version "8.3.0"
id 'java-library'
id 'checkstyle'
id "io.freefair.lombok" version "6.4.0"
id 'jacoco'
id 'com.diffplug.spotless' version '6.19.0'
Expand All @@ -84,18 +83,7 @@ repositories {
spotless {
java {
target fileTree('.') {
include 'datasources/**/*.java',
'core/**/*.java',
'protocol/**/*.java',
'prometheus/**/*.java',
'sql/**/*.java',
'common/**/*.java',
'spark/**/*.java',
'plugin/**/*.java',
'ppl/**/*.java',
'integ-test/**/*java',
'core/**/*.java',
'opensearch/**/*.java'
include '**/*.java'
exclude '**/build/**', '**/build-*/**'
}
importOrder()
Expand Down Expand Up @@ -194,22 +182,6 @@ jacocoTestCoverageVerification {
}
check.dependsOn jacocoTestCoverageVerification

// TODO: fix code style in main and test source code
allprojects {
apply plugin: 'checkstyle'
checkstyle {
configFile rootProject.file("config/checkstyle/google_checks.xml")
toolVersion "10.3.2"
configProperties = [
"org.checkstyle.google.suppressionfilter.config": rootProject.file("config/checkstyle/suppressions.xml")]
ignoreFailures = false
}
}
checkstyle {
configFile file("config/checkstyle/checkstyle.xml")
}
checkstyleMain.ignoreFailures = false
checkstyleTest.ignoreFailures = true

configurations.all {
resolutionStrategy.force 'junit:junit:4.13.2'
Expand Down
5 changes: 0 additions & 5 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ 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

dependencies {
api "org.antlr:antlr4-runtime:4.7.1"
api group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
Expand Down
120 changes: 0 additions & 120 deletions config/checkstyle/checkstyle.xml

This file was deleted.

Loading