Skip to content

Commit

Permalink
Merge pull request #59 from openrewrite/rpau-parse-error
Browse files Browse the repository at this point in the history
Support for tree.ParseError instead of ParseError
  • Loading branch information
rpau authored Jun 29, 2023
2 parents 2b7c4f4 + 5cea4cf commit 2980a15
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
31 changes: 28 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("org.openrewrite.build.recipe-library") version "latest.release"
id("org.openrewrite.build.shadow") version "latest.release"
id("org.openrewrite.build.recipe-library") version "latest.integration"
id("org.openrewrite.build.shadow") version "latest.integration"
id("nebula.release") version "17.1.0"
}
group = "org.openrewrite"
description = "Rewrite Python"
Expand All @@ -10,12 +11,28 @@ task("printIntellijDependencies", JavaExec::class) {
classpath = sourceSets["main"].runtimeClasspath
}

val latest = rewriteRecipe.rewriteVersion.get()
configurations {
all {
resolutionStrategy {
cacheChangingModulesFor(1, TimeUnit.HOURS)
cacheDynamicVersionsFor(1, TimeUnit.HOURS)
exclude("ch.qos.logback")
}
}
}

val latest = if (project.hasProperty("releasing")) {
"latest.release"
} else {
"latest.integration"
}

val lib = fileTree("lib")
dependencies {
compileOnly("org.openrewrite:rewrite-test")

implementation(platform("org.openrewrite:rewrite-bom:$latest"))
implementation("org.openrewrite:rewrite-core")
implementation("org.openrewrite:rewrite-java")
implementation(lib)

Expand All @@ -37,6 +54,14 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
}

repositories {
mavenLocal()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
mavenCentral()
}

val shadowJar = tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
from(lib)
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/openrewrite/python/PythonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.openrewrite.python.internal.PsiPythonMapper;
import org.openrewrite.python.tree.Py;
import org.openrewrite.style.NamedStyles;
import org.openrewrite.tree.ParseError;
import org.openrewrite.tree.ParsingEventListener;
import org.openrewrite.tree.ParsingExecutionContextView;

Expand All @@ -42,7 +43,6 @@ public class PythonParser implements Parser {
private final List<NamedStyles> styles;
private final boolean logCompilationWarningsAndErrors;
private final JavaTypeCache typeCache;

@Override
public Stream<SourceFile> parse(String... sources) {
List<Input> inputs = new ArrayList<>(sources.length);
Expand Down

0 comments on commit 2980a15

Please sign in to comment.