Skip to content

Commit

Permalink
Start priming build for latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Jul 4, 2021
1 parent 4c238b4 commit 11817f4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@
<links>
<link>https://checkerframework.org/api/</link>
<link>https://junit.org/junit5/docs/current/api/</link>
<link>https://repo.karuslabs.com/repository/chimera/${repository-head}/annotations/apidocs</link>
<!-- <link>https://repo.karuslabs.com/repository/chimera/${repository-head}/annotations/apidocs</link>
<link>https://repo.karuslabs.com/repository/chimera/${repository-head}/commons/apidocs</link>
<link>https://repo.karuslabs.com/repository/chimera/${repository-head}/typist/apidocs</link>
<link>https://repo.karuslabs.com/repository/chimera/${repository-head}/typist/apidocs</link>-->
</links>
</configuration>
<executions>
Expand Down
13 changes: 13 additions & 0 deletions typist/nbactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>CUSTOM-Debug</actionName>
<displayName>Debug</displayName>
<goals>
<goal>-Dcheckstyle.skip</goal>
</goals>
<properties>
<skipTests>true</skipTests>
</properties>
</action>
</actions>
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void lint(Environment environment, Command command) {
for (var binding : command.bindings().values()) {
if (binding instanceof Method method) {
for (var reference : method.parameters(command).values()) {
lint(environment, command, reference);
lint(environment, reference);
}
}
}
Expand All @@ -78,8 +78,8 @@ public void lint(Environment environment, Command command) {
* @param command the command
* @param reference the reference
*/
void lint(Environment environment, Command command, Reference reference) {
var argument = command.binding(Pattern.ARGUMENT_TYPE);
void lint(Environment environment, Reference reference) {
var argument = reference.value().binding(Pattern.ARGUMENT_TYPE);
if (argument == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.karuslabs.typist.parsers.BindParser.Captor;
import com.karuslabs.utilitary.Logger;

import java.util.*;
import javax.lang.model.element.*;

import org.junit.jupiter.api.*;
Expand Down Expand Up @@ -63,6 +64,10 @@ class Cases {
@Bind(pattern = "<b>")
void self(CommandContext<CommandSender> context, CommandSender s, @Let int b) {}
@Case("reference")
@Bind(pattern = "<c>")
void reference(CommandContext<CommandSender> context, CommandSender s, @Let int b, @Let String c) {}
@Case("previous")
@Bind(pattern = "<c>")
void previous(CommandContext<CommandSender> context, CommandSender s, @Let int b) {}
Expand Down Expand Up @@ -103,6 +108,23 @@ void lint_valid(String method, String type) {
verifyNoInteractions(logger);
}

@Test
void lint_references_correct_command() {
var executable = (ExecutableElement) cases.one("reference");
var b = executable.getParameters().get(2);
var c = executable.getParameters().get(3);

commands.parse(environment, cases.one("class"));
bindings.parse(environment, Set.of(executable, cases.one("b"), cases.one("c")));
bindings.parse(environment, executable);
lets.parse(environment, b);
lets.parse(environment, c);

Lint.lint(environment, lint);

verifyNoInteractions(logger);
}

@Test
void lint_raw() {
var element = lint("raw", "raw_type");
Expand Down Expand Up @@ -136,4 +158,4 @@ Element lint(String method, String type) {
return parameter;
}

}
}

0 comments on commit 11817f4

Please sign in to comment.