mirror of
https://github.com/apple/pkl.git
synced 2026-04-23 08:48:36 +02:00
Adjust filename according to style guide (#484)
This commit is contained in:
@@ -284,9 +284,9 @@ This terminology describes the _intended use_ of the module and doesn't imply an
|
|||||||
In other words: just by looking at Pkl code, you can't tell whether it is a template or a "normal" module.
|
In other words: just by looking at Pkl code, you can't tell whether it is a template or a "normal" module.
|
||||||
|
|
||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.acmecicd.pkl
|
.AcmeCICD.pkl
|
||||||
----
|
----
|
||||||
module acmecicd
|
module AcmeCICD
|
||||||
|
|
||||||
class Pipeline {
|
class Pipeline {
|
||||||
name: String(nameRequiresBranchName)?
|
name: String(nameRequiresBranchName)?
|
||||||
@@ -316,7 +316,7 @@ Next, add a time-out of one minute for your job.
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.cicd.pkl
|
.cicd.pkl
|
||||||
----
|
----
|
||||||
amends "acmecicd.pkl"
|
amends "AcmeCICD.pkl"
|
||||||
|
|
||||||
timeout = 1
|
timeout = 1
|
||||||
----
|
----
|
||||||
@@ -329,7 +329,7 @@ Value: 1 // <3>
|
|||||||
|
|
||||||
225 | timeout: Int(this >= 3)? // <4>
|
225 | timeout: Int(this >= 3)? // <4>
|
||||||
^^^^^^^^^
|
^^^^^^^^^
|
||||||
at acmecicd#timeout (file:///Users/me/tutorial/acmecicd.pkl, line 8)
|
at AcmeCICD#timeout (file:///Users/me/tutorial/AcmeCICD.pkl, line 8)
|
||||||
|
|
||||||
3 | timeout = 1 // <5>
|
3 | timeout = 1 // <5>
|
||||||
^
|
^
|
||||||
@@ -369,7 +369,7 @@ Start off by specifying the name of the pipeline and nothing else.
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.cicd.pkl
|
.cicd.pkl
|
||||||
----
|
----
|
||||||
amends "acmecicd.pkl"
|
amends "AcmeCICD.pkl"
|
||||||
|
|
||||||
timeout = 3
|
timeout = 3
|
||||||
pipelines {
|
pipelines {
|
||||||
@@ -403,7 +403,7 @@ Pipelines that set a 'name' must also set a 'branchName'.
|
|||||||
|
|
||||||
8 | throw("Pipelines that set a 'name' must also set a 'branchName'.")
|
8 | throw("Pipelines that set a 'name' must also set a 'branchName'.")
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
at acmecicd#Pipeline.nameRequiresBranchName.<function#1> (file:///Users/me/tutorial/acmecicd.pkl, line 8)
|
at AcmeCICD#Pipeline.nameRequiresBranchName.<function#1> (file:///Users/me/tutorial/AcmeCICD.pkl, line 8)
|
||||||
|
|
||||||
6 | name = "prb"
|
6 | name = "prb"
|
||||||
^^^^^
|
^^^^^
|
||||||
@@ -424,7 +424,7 @@ The message is quite instructive, so you can fix the error by adding a `branchNa
|
|||||||
[source,{pkl}]
|
[source,{pkl}]
|
||||||
.cicd.pkl
|
.cicd.pkl
|
||||||
----
|
----
|
||||||
amends "acmecicd.pkl"
|
amends "AcmeCICD.pkl"
|
||||||
|
|
||||||
timeout = 3
|
timeout = 3
|
||||||
pipelines {
|
pipelines {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include::ROOT:partial$component-attributes.adoc[]
|
|||||||
|
|
||||||
In parts xref:01_basic_config.adoc[one] and xref:02_filling_out_a_template.adoc[two], you saw that Pkl provides _validation_ of our configurations.
|
In parts xref:01_basic_config.adoc[one] and xref:02_filling_out_a_template.adoc[two], you saw that Pkl provides _validation_ of our configurations.
|
||||||
It checks syntax, types and constraints.
|
It checks syntax, types and constraints.
|
||||||
As you saw in the `acmecicd` example xref:02_filling_out_a_template.adoc#amending-templates[here], the template can provide informative error messages when an amending module violates a type constraint.
|
As you saw in the `AcmeCICD` example xref:02_filling_out_a_template.adoc#amending-templates[here], the template can provide informative error messages when an amending module violates a type constraint.
|
||||||
|
|
||||||
In this final part, you will see some of Pkl's techniques that are particularly relevant for writing a template.
|
In this final part, you will see some of Pkl's techniques that are particularly relevant for writing a template.
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ By "precisely" we mean, that amending an object also can't "turn it into" an ins
|
|||||||
== A new template
|
== A new template
|
||||||
|
|
||||||
Now that you know about types, you can start writing your first template.
|
Now that you know about types, you can start writing your first template.
|
||||||
So far, you've written configurations with Pkl, either without a template, or using the `acmecicd` template from xref:02_filling_out_a_template.adoc#amending-templates[Amending templates].
|
So far, you've written configurations with Pkl, either without a template, or using the `AcmeCICD` template from xref:02_filling_out_a_template.adoc#amending-templates[Amending templates].
|
||||||
It is often easiest to first write a (typical) configuration for which you want to create a template.
|
It is often easiest to first write a (typical) configuration for which you want to create a template.
|
||||||
Suppose you want to define what a live workshop for this tutorial looks like.
|
Suppose you want to define what a live workshop for this tutorial looks like.
|
||||||
Consider this example:
|
Consider this example:
|
||||||
|
|||||||
Reference in New Issue
Block a user