Skip to content

Commit

Permalink
Update spotless config (#1349)
Browse files Browse the repository at this point in the history
* Apply spotless to buildSrc

* Apply spotless

* Update spotless version

* Apply spotless

* Another spotless update

* Apply spotless
  • Loading branch information
trask authored Oct 9, 2020
1 parent bb26c17 commit 4624584
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 62 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {

id "com.github.johnrengelman.shadow" version "6.0.0"

id "com.diffplug.gradle.spotless" version "4.3.0"
id "com.diffplug.spotless" version "5.6.1"
id "com.github.spotbugs" version "4.0.1"

id "net.ltgt.errorprone" version "1.2.1" apply false
Expand Down Expand Up @@ -62,7 +62,7 @@ allprojects {
}
}

apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'com.diffplug.spotless'

spotless {
// this formatting is applied at the root level, as some of these files are not in a submodules
Expand Down
52 changes: 52 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
plugins {
id 'groovy'
id 'java-gradle-plugin'
id "com.diffplug.spotless" version "5.6.1"
}

spotless {
java {
googleJavaFormat()
licenseHeaderFile rootProject.file('../gradle/enforcement/spotless.license.java'), '(package|import|public)'
target 'src/**/*.java'
}
groovy {
licenseHeaderFile rootProject.file('../gradle/enforcement/spotless.license.java'), '(package|import|class)'
}
}

gradlePlugin {
plugins {
create("muzzle-plugin") {
id = "muzzle"
implementationClass = "MuzzlePlugin"
}
create("auto-instrumentation-plugin") {
id = "io.opentelemetry.instrumentation.auto-instrumentation"
implementationClass = "io.opentelemetry.instrumentation.gradle.AutoInstrumentationPlugin"
}
}
}

repositories {
mavenLocal()
jcenter()
mavenCentral()
}

dependencies {
implementation(gradleApi())
implementation(localGroovy())

implementation group: "org.eclipse.aether", name: "aether-connector-basic", version: "1.1.0"
implementation group: "org.eclipse.aether", name: "aether-transport-http", version: "1.1.0"
implementation group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9"

implementation group: "com.google.guava", name: "guava", version: "20.0"
implementation group: "org.ow2.asm", name: "asm", version: "7.0-beta"
implementation group: "org.ow2.asm", name: "asm-tree", version: "7.0-beta"
implementation group: "org.apache.httpcomponents", name: "httpclient", version: "4.5.10"

testImplementation group: "org.spockframework", name: "spock-core", version: "1.3-groovy-2.5"
testImplementation group: "org.codehaus.groovy", name: "groovy-all", version: "2.5.8"
}
41 changes: 0 additions & 41 deletions buildSrc/build.gradle.kts

This file was deleted.

5 changes: 5 additions & 0 deletions buildSrc/src/main/groovy/MuzzlePlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

import java.lang.reflect.Method
import java.security.SecureClassLoader
import java.util.concurrent.atomic.AtomicReference
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
/*
* Copyright The OpenTelemetry Authors
*
* 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.
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.gradle;
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/test/groovy/RangeQueryTest.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

import org.eclipse.aether.RepositorySystem
import org.eclipse.aether.RepositorySystemSession
import org.eclipse.aether.artifact.Artifact
Expand Down
4 changes: 2 additions & 2 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'com.diffplug.spotless'

spotless {
java {
Expand All @@ -21,7 +21,7 @@ spotless {
}
format 'misc', {
// not using '**/...' to help keep spotless fast
target '.gitignore', '*.md', 'src/**/.md', '*.sh'
target '.gitignore', '*.md', 'src/**/*.md', '*.sh', 'src/**/*.properties'
indentWithSpaces()
trimTrailingWhitespace()
endWithNewline()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ public Object apply(Object session) {
return session;
}
return new TracingCqlSession((CqlSession) session);
};
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
log4j.rootLogger=INFO, LIST
log4j.appender.LIST=ListAppender
log4j.appender.LIST=ListAppender
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ private void addSpanProcessors(List<SpanExporter> spanExporters) {

private void setSampler(TracerProperties tracerProperties) {
TraceConfig updatedTraceConfig =
OpenTelemetrySdk.getTracerManagement()
.getActiveTraceConfig()
.toBuilder()
OpenTelemetrySdk.getTracerManagement().getActiveTraceConfig().toBuilder()
.setSampler(Samplers.traceIdRatioBased(tracerProperties.getSamplerProbability()))
.build();

Expand Down

0 comments on commit 4624584

Please sign in to comment.