-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly convert env interactions into context (#271)
* properly convert env interactions into context This input: ```yaml {% set a = environ["a"] %} {% set b = environ.get("b", "0") %} package: name: abc version: 0 ``` on `main` emits this recipe that needs manual correction: ```yaml schema_version: 1 context: a: "\"env.get(\"a\")\"" b: "\"environ | get(\"b\", \"0\")\"" package: name: abc version: 0 ``` but after this PR, it will instead emit: ```yaml schema_version: 1 context: a: ${{env.get("a")}} b: ${{env.get("b", default="0")}} package: name: abc version: 0 ``` which does not need any further editing. * fix black formatting issues * fix incorrect mypy typing * add test case * add tests, comments, consistency pass on env.get
- Loading branch information
1 parent
b02a878
commit e2bf2cb
Showing
8 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% set a = env.get("a") %} | ||
{% set b = env.get("b", default="0") %} | ||
|
||
package: | ||
name: abc | ||
version: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% set a = env.get("a") %} | ||
{% set b = env.get("b", default="0") %} | ||
|
||
package: | ||
name: abc | ||
version: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% set a = environ["a"] %} | ||
{% set b = environ.get("b", "0") %} | ||
|
||
package: | ||
name: abc | ||
version: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
schema_version: 1 | ||
|
||
context: | ||
a: ${{env.get("a")}} | ||
b: ${{env.get("b", default="0")}} | ||
|
||
package: | ||
name: abc | ||
version: 0 |