Commit Graph
571 Commits
Author SHA1 Message Date
translatenixandGitHub 1022cf3ff3 Replace some usages of java.lang.String.replaceAll with String.replace (#701)
Both methods replace all occurrences.
The difference is that String.replaceAll interprets its first argument as a regex.
2024-10-16 15:00:45 -07:00
421711be10 Improve let-expression examples (#680) (#699)
Because I did not understand what a `Let Expression` should be and the example code was more confusing as explanatory, I changed the format of the examples a little bit and changed the result.

- It should be clear that the example is just one code-line
- I tried out the example (`pkl eval...`) and get a little bit different result

Co-authored-by: ManuW <ManuW@users.noreply.github.com>
2024-10-16 13:10:48 +01:00
translatenixandGitHub 475f29c896 Set lower limit for glob pattern resolution in test mode (#693)
Motivation:
Speed up the test that verifies enforcement of the limit for glob pattern resolution (invalidGlobImport6.pkl).

Changes:
- Set a lower limit if test mode is enabled.
- Change static field to static method to prevent compile-time evaluation by native-image.
2024-10-15 22:20:25 -07:00
translatenixandGitHub d00c466843 Fix dangling Javadoc reference (#687) 2024-10-15 08:26:35 -07:00
translatenixandGitHub 7f26592360 Use case-insensitive comparison for module URI schemes (#688)
Previously, some factories used case-sensitive comparison, for no apparent reason.
2024-10-15 08:26:23 -07:00
translatenixandGitHub 4854027a1a Update Gradle to 8.10.2 (#684)
Verify wrapper JAR according to:
https://docs.gradle.org/current/userguide/gradle_wrapper.html#wrapper_checksum_verification
2024-10-14 22:53:26 -07:00
translatenixandGitHub 2961cdad19 Update Windows and Mac development instructions (#685) 2024-10-14 22:52:59 -07:00
translatenixandGitHub b76ff0f858 Don't run native Windows tests during pkl-core:test (#686) 2024-10-14 22:51:28 -07:00
translatenixandGitHub bc9d526b7a Update DEVELOPMENT.adoc (#682) 2024-10-14 11:00:16 +02:00
Daniel ChaoandGitHub 3600582908 Add .vscode and .pkl-lsp to gitignore (#677) 2024-10-11 07:59:35 -07:00
1e63c48ce4 Add String.splitLimit API (#666)
* Add String.splitLimit API

* Update stdlib/base.pkl

Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>

---------

Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
2024-10-07 15:28:19 +01:00
Max Rydahl AndersenandGitHub 9e7e42eb53 add jbang catalog (#655) 2024-10-07 13:13:38 +02:00
Josh BandGitHub b072794d0d Handle null contents gracefully in message passing API (#657)
In messages "Read Resource Response" and "Read Module Response", if `contents` and `error` are both null, default to an empty byte array/string.

This resolves one of the issues reported in #656
2024-10-01 12:54:06 -07:00
Philip K.F. HölzenspiesandGitHub cc1e432a30 Add PklProject.deps.json file with newline for POSIX compliance (#664)
* Add Project.deps.json file with newline for POSIX compliance

* Fix test cases
2024-10-01 20:00:46 +01:00
Daniel ChaoandGitHub 47f2143e0d Fix PklBugException when reading local package assets (#642) 2024-09-10 05:51:34 -07:00
Daniel ChaoandGitHub 7868d9d9c8 Typecheck Mapping/Listing members lazily (#628)
This changes how the language performs typechecks for mappings and
listings.

Currently, Pkl will shallow-force any Mapping and Listing to check it
the type parameter (e.g. Listing<Person> means each element is checked
to be an instance of Person).

This changes the language to check each member's type when the member
is accessed.

This also adjust test runner to handle thrown errors from within tests.

With the change to make mapping/listing typechecks lazy, we can now
correctly handle thrown errors from within a single test case.

This adjusts the test runner to consider any thrown errors as a failure
for that specific test case.
2024-09-06 15:05:23 -07:00
Josh BandGitHub 7001a42149 [docs] Add documentation for new keyword (#624) 2024-08-29 15:25:14 -07:00
Philip K.F. HölzenspiesandGitHub a8f24c9f13 Fix parsing of external property values containing = (#631) 2024-08-20 13:28:13 +01:00
Josh BandGitHub e5b7e046d9 [docs] Improve searchability of "Methods" section (#625) 2024-08-19 15:54:46 -07:00
LamTrinh.DevandGitHub ef0433a9ba Correct the link for ANTLR 4 Documentation (#623) 2024-08-15 20:15:26 -07:00
Josh BandGitHub a9c4963a4a [docs] Document the class-as-a-function pattern (#614) 2024-08-15 17:06:56 -07:00
Philip K.F. HölzenspiesandGitHub e21db76efe Remove const from reserved keywords (remnant) (#626) 2024-08-14 14:48:49 +01:00
bbdc45656c [docs] Document hidden equality/hashing behavior (#618)
* [docs] Document `hidden` equality/hashing behavior

* Update docs/modules/language-reference/pages/index.adoc

---------

Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
2024-08-13 09:56:15 +02:00
Josh BandGitHub c445770261 [docs] Add mention of "optional" to nullably types section (#613) 2024-08-07 12:18:50 -07:00
Daniel ChaoandGitHub b1c2015321 Cherry pick 0.26.3 release notes (#615) 2024-08-06 12:08:44 -07:00
Daniel ChaoandGitHub 7c4904429f Fix: make Gradle tests compatible with Gradle 8.1 (#610)
The tests were using assignment expressions, a Kotlin compiler feature
only available in Gradle 8.2 and onwards.
2024-08-06 07:55:13 -07:00
Daniel ChaoandGitHub d5e86ed077 Fix: globbing--read extra storage from owner instead of receiver (#607)
This fixes an issue where a PklBugException is thrown when a globbed
read/import is amended.
2024-08-05 10:27:50 -07:00
Daniel ChaoandGitHub 604b042d1b Make EvalTask track resolved output paths and fix file() notation on Gradle on Windows (#403)
* Add `getEffectiveOutputFiles` and `getEffectiveOutputDirs` to `EvalTask`, and mark them as output files/dirs so they are tracked by Gradle. This enables implicit dependency tracking between two tasks.
* Fix usage of `file()` notation in Gradle scripts when on Windows.
2024-07-25 17:41:03 -07:00
Islon SchererandGitHub e3133f604b Fix property parsing bug in the cli (#596) 2024-07-25 09:27:38 +02:00
XIAO YUandGitHub bfc2d7abbf refactor: Simplify regex pattern for code block matching (#592) 2024-07-24 15:13:49 +01:00
XIAO YUandGitHub 0704b8cd83 Remove redundant suppression (#594) 2024-07-22 17:14:54 -07:00
Daniel ChaoandGitHub e81a47a038 Import release notes for 0.26.2 (#587) 2024-07-18 09:39:13 -07:00
Daniel ChaoandGitHub 176ede0002 Fix race condition when concurrently downloading packages (#584)
This fixes a possible race condition where multiple processes download
the same package into the same temp dir.
2024-07-18 09:11:25 -07:00
Islon SchererandGitHub 24cc95abcc Support _ in String[toInt|toIntOrNull|toFloat|toFloatOrNull] (#580)
The logic is the same as the Pkl parser
2024-07-16 19:24:59 +02:00
Taichi IshitaniandGitHub b5e011dae1 Allow to toInt() to parse a string including "__" (#578)
Fix the issue where String#toInt() cannot parse a Int string
including sequence of "_" like "1_2__3___".
2024-07-15 10:39:17 +02:00
Thomas PurchasandGitHub cdf548cad0 Add CSS to make top doc box have a fade, rather than hard cutoff (#570)
The current hard cutoff in the docs often results in people not
realising that the doc box can be expanded, and often resulting in
confusion because the most helpful examples are often in the module doc
box.

This change uses some simple CSS tweaks to replace the hard cut-off with
a visualfade, so it's obvious that there's content hidden out of view.
Doing this required removing the CSS transition, as it hard to correctly
transition the height property of CSS element of unknown target height.
But the improved discoverablility of the doc content seems like a
worthwhile tradeoff.
2024-07-08 15:12:24 +01:00
Philip K.F. HölzenspiesandGitHub 5cc2ea2d00 Revert error coloring (for development on dedicated branch) (#565) 2024-07-03 17:25:06 +01:00
Dan ChaoandDaniel Chao 527d236ba4 Add Git ignore-revs file 2024-07-01 09:24:04 -07:00
Dan ChaoandDaniel Chao 8c1c10528f Run spotless apply 2024-07-01 09:24:04 -07:00
Dan ChaoandDaniel Chao 7a9b571f6e Use spotless to format remaining Kotlin files
Also: fix issue where some commented out Kotlin files are invalid.
2024-07-01 09:24:04 -07:00
Thomas PurchasandPhilip K.F. Hölzenspies 3659ad8b7a Add test for colour outputs
Test two error conditions that cover all current colour outputs.
2024-07-01 10:13:16 +01:00
Thomas PurchasandPhilip K.F. Hölzenspies 0d7b95d3ff Add colours to Pkl errors in Cli output
To make error messages from Pkl eval easier to read, this change uses
the Jansi library to colour the output, making it quicker and easier to
scan error messages and understand what's happened.

The Jansi library also detects if the CLI output is a terminal capable
of handling colours, and will automatically strip out escape codes if
the output won't support them (e.g. piping the output somewhere else).
2024-07-01 10:13:16 +01:00
Daniel ChaoandGitHub 49aaf288cc Cherry-pick release notes for 0.26.1 (#557) 2024-06-28 10:23:24 -07:00
Daniel ChaoandGitHub 51d7265ec6 Do not enable TLS certificate revocation checks by default (#553)
This addresses an issue where network requests may fail if cert revocation checks
error, which may occur due to availability issues, or due to lack of internet access.

Revocation checking can still be enabled by setting JVM property com.sun.net.ssl.checkRevocation if on the JVM.

Also:
* Load built-in certs from resources, and move them to pkl-commons-cli
* Fix an issue where HttpInitException is not caught when loading a module
2024-06-28 08:57:46 -07:00
Daniel ChaoandGitHub 420336dc78 Only run Gradle compatibility tests against releases in CI (#554)
This fixes our CI tests on main. It mitigates an issue where the current RC is borked right now.
2024-06-28 07:57:27 -07:00
Daniel ChaoandGitHub 70e77347f3 Use compatible architecture in native executables (#551)
Use the most compatible architecture; for example, x86-64 instead of
x86-64-v3.
2024-06-27 07:39:17 -07:00
Philip K.F. HölzenspiesandPhilip K.F. Hölzenspies 3b786878fd Pass HOMEBREW_* environment variables on through native_image 2024-06-26 16:31:31 +01:00
Philip K.F. HölzenspiesandPhilip K.F. Hölzenspies 64bfcfdc4f Resolve project dirs from working dir by default 2024-06-25 13:13:48 +01:00
Daniel ChaoandGitHub 5c950d2e73 docs: add contributor for 0.26 release (#546)
Add a contributor name who was missing from acknowledgements.
2024-06-24 07:47:26 -07:00
Philip K.F. HölzenspiesandPhilip K.F. Hölzenspies 0ef22a73fb Start next dev iteration 2024-06-17 19:53:30 +01:00