-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
482 changed files
with
8,652 additions
and
6,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Dependency Submission | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["publish"] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
dependency-submission: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
- name: Generate and submit dependency graph | ||
uses: gradle/actions/dependency-submission@v3 | ||
env: | ||
# Exclude all dependencies that originate solely in the 'buildSrc' project | ||
DEPENDENCY_GRAPH_EXCLUDE_PROJECTS: ':buildSrc' | ||
# Exclude dependencies that are only resolved in test classpaths | ||
DEPENDENCY_GRAPH_EXCLUDE_CONFIGURATIONS: '.*[Tt]est(Compile|Runtime)Classpath' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 5. Parser and LST Design Conventions and Best Practices | ||
|
||
## Status | ||
|
||
Draft | ||
|
||
## Context | ||
|
||
As we have developed parsers for more programming languages and data formats a number of conventions and best practices | ||
have emerged. This document is intended to capture and codify those conventions and best practices. | ||
|
||
## Decision | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
rewrite-core/src/main/java/org/openrewrite/FindDeserializationErrors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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. | ||
*/ | ||
package org.openrewrite; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Value; | ||
import org.openrewrite.marker.DeserializationError; | ||
import org.openrewrite.marker.LstProvenance; | ||
import org.openrewrite.marker.Markup; | ||
import org.openrewrite.marker.OutdatedSerializer; | ||
import org.openrewrite.table.DeserializationErrorTable; | ||
|
||
import java.time.Instant; | ||
import java.time.ZonedDateTime; | ||
import java.util.Optional; | ||
|
||
import static java.time.ZoneOffset.UTC; | ||
|
||
@Value | ||
@EqualsAndHashCode(callSuper = false) | ||
public class FindDeserializationErrors extends Recipe { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Find deserialization errors"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Produces a data table collecting all deserialization errors of serialized LSTs."; | ||
} | ||
|
||
transient DeserializationErrorTable dataTable = new DeserializationErrorTable(this); | ||
|
||
@Override | ||
public TreeVisitor<?, ExecutionContext> getVisitor() { | ||
return new TreeVisitor<Tree, ExecutionContext>() { | ||
@Override | ||
public Tree preVisit(Tree tree, ExecutionContext ctx) { | ||
stopAfterPreVisit(); | ||
return tree.getMarkers().findFirst(DeserializationError.class) | ||
.map(error -> { | ||
Optional<OutdatedSerializer> outdatedSerializer = tree.getMarkers().findFirst(OutdatedSerializer.class); | ||
Optional<LstProvenance> lstProvenance = tree.getMarkers().findFirst(LstProvenance.class); | ||
dataTable.insertRow(ctx, new DeserializationErrorTable.Row( | ||
tree instanceof SourceFile ? ((SourceFile) tree).getSourcePath().toString() : null, | ||
error.getMessage(), | ||
error.getDetail(), | ||
outdatedSerializer.map(OutdatedSerializer::getLanguage).orElse(null), | ||
outdatedSerializer.map(OutdatedSerializer::getMinimumVersion).orElse(null), | ||
outdatedSerializer.map(OutdatedSerializer::getActualVersion) | ||
.orElseGet(() -> lstProvenance.map(LstProvenance::getBuildToolVersion).orElse(null)), | ||
lstProvenance.map(LstProvenance::getTimestampUtc).map(Instant::toEpochMilli).orElse(null), | ||
lstProvenance.map(LstProvenance::getTimestampUtc).map(ts -> ts.atZone(UTC)).map(ZonedDateTime::toString).orElse(null) | ||
)); | ||
|
||
return Markup.info(tree, error.getMessage()); | ||
}) | ||
.orElse(tree); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.