Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^integration-tests/jbang/EmptyPIPComments\.j$
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/jbang/EmptyPIPComments.j
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
//DEPS org.graalvm.python:jbang:${env.GRAALPY_VERSION:26.0.0}
//PIP
// one blank after PIP
//PIP
//PIP
// three blanks after PIP
//PIP
//PIP

public class EmptyPIPComments {
public static void main(String[] args) {
Expand Down
1 change: 1 addition & 0 deletions integration-tests/test_jbang_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def check_empty_comments(self, work_dir, java_file, log):
self.assertEqual(0, result, f"command: {command}\n stdout: {out}")
self.assertNotIn("[graalpy jbang integration]", out)

@unittest.skip # https://github.com/jbangdev/jbang/issues/2236
def test_malformed_tag_formats(self):
jbang_templates_dir = os.path.join(os.path.dirname(__file__), "jbang")
work_dir = self.tmpdir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ public static Map<String, Object> postBuild(Path temporaryJar, Path pomFile,
resourcesDirectory = Path.of(path);
}
} else if (comment.startsWith(PIP)) {
pkgs.addAll(Arrays.stream(comment.substring(PIP.length()).trim().split(" "))
.filter(s -> !s.trim().isEmpty()).collect(Collectors.toList()));
String content = comment.substring(PIP.length()).trim();
if (!content.isEmpty()) {
pkgs.addAll(Arrays.stream(content.split("\\s+")).filter(x -> !x.isBlank())
.collect(Collectors.toList()));
}
}
}
if (!pkgs.isEmpty()) {
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<source>21</source>
<target>21</target>
<release>21</release>
<source>17</source>
<target>17</target>
<release>17</release>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Werror</arg>
Expand Down