implements PLN-0116
This commit is contained in:
+23
@@ -75,6 +75,29 @@ class FrontendProviderBoundaryTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void commonLspMustNotImportPbsImplementationPackages() throws IOException {
|
||||
final var repoRoot = findRepoRoot(Path.of("").toAbsolutePath().normalize());
|
||||
final var sourceRoot = repoRoot.resolve("prometeu-lsp/prometeu-lsp-v1/src/main/java");
|
||||
final var prohibitedNeedles = List.of(
|
||||
"p.studio.compiler.PBSFrontendLanguageService",
|
||||
"p.studio.compiler.services.PBSFrontendPhaseService",
|
||||
"p.studio.compiler.pbs",
|
||||
"PbsAst",
|
||||
"PbsEditorial");
|
||||
|
||||
try (final var files = Files.walk(sourceRoot)) {
|
||||
final var violations = files
|
||||
.filter(path -> path.toString().endsWith(".java"))
|
||||
.filter(path -> prohibitedNeedles.stream().anyMatch(needle -> contains(path, needle)))
|
||||
.toList();
|
||||
if (!violations.isEmpty()) {
|
||||
fail("common LSP code must consume generic frontend language-service contracts instead of PBS implementation packages: "
|
||||
+ violations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void compileOnlyFrontendProviderMayOmitLanguageService() {
|
||||
final FrontendProvider provider = new CompileOnlyFrontendProvider();
|
||||
|
||||
Reference in New Issue
Block a user