Only allow shebangs in the beginning of a module (#1126)

This commit is contained in:
Islon Scherer
2025-07-18 11:18:45 +02:00
committed by GitHub
parent decb4ea66e
commit ba82c5c6d6
6 changed files with 20 additions and 4 deletions
@@ -0,0 +1,2 @@
foo = 1
#!/usr/bin/env pkl eval
@@ -0,0 +1,2 @@
#!/usr/bin/env pkl eval
foo = 1
@@ -0,0 +1,6 @@
–– Pkl Error ––
Invalid token at position. Expected a class, typealias, method, or property.
x | #!/usr/bin/env pkl eval
^^^^^^^^^^^^^^^^^^^^^^^
at shebang (file:///$snippetsDir/input/errors/shebang.pkl)
@@ -0,0 +1 @@
foo = 1