python-hcl2 6.0.0__tar.gz → 6.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/CHANGELOG.md +14 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/PKG-INFO +1 -1
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/hcl2.lark +5 -4
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/transformer.py +11 -1
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/version.py +2 -2
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/PKG-INFO +1 -1
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.codacy.yml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.coveragerc +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.github/CODEOWNERS +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.github/workflows/codeql-analysis.yml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.github/workflows/pr_check.yml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.github/workflows/publish.yml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.gitignore +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.pre-commit-config.yaml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/.yamllint.yml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/LICENSE +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/MANIFEST.in +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/README.md +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/bin/terraform_test +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/__init__.py +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/__main__.py +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/api.py +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/builder.py +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/parser.py +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/py.typed +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/hcl2/reconstructor.py +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/mypy.ini +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/pylintrc +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/pyproject.toml +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/SOURCES.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/dependency_links.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/entry_points.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/not-zip-safe +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/requires.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/python_hcl2.egg-info/top_level.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/reports/.gitignore +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/requirements.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/setup.cfg +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/test-requirements.txt +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/tox.ini +0 -0
- {python-hcl2-6.0.0 → python-hcl2-6.1.1}/tree-to-hcl2-reconstruction.md +0 -0
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## \[6.1.1\] - 2025-02-13
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `DictTransformer.to_tf_inline` - handle float type. ([#188](https://github.com/amplify-education/python-hcl2/pull/188))
|
|
13
|
+
|
|
14
|
+
## \[6.1.0\] - 2025-01-24
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- fix e-notation and negative numbers literals. ([#182](https://github.com/amplify-education/python-hcl2/pull/182))
|
|
19
|
+
- fix parsing of `null`. ([#184](https://github.com/amplify-education/python-hcl2/pull/184))
|
|
20
|
+
- DictTransformer - do not wrap type literals into `${` and `}`. ([#186](https://github.com/amplify-education/python-hcl2/pull/186))
|
|
21
|
+
|
|
8
22
|
## \[6.0.0\] - 2025-01-15
|
|
9
23
|
|
|
10
24
|
### Added
|
|
@@ -61,11 +61,12 @@ STRING_CHARS : /(?:(?!\${)([^"\\]|\\.))+/ // any character except '"'
|
|
|
61
61
|
string_with_interpolation: "\"" (STRING_CHARS)* interpolation_maybe_nested (STRING_CHARS | interpolation_maybe_nested)* "\""
|
|
62
62
|
interpolation_maybe_nested: "${" expression "}"
|
|
63
63
|
|
|
64
|
-
int_lit : DECIMAL+
|
|
65
|
-
!float_lit: DECIMAL+ "." DECIMAL+ (EXP_MARK
|
|
66
|
-
| DECIMAL+ ("." DECIMAL+)? EXP_MARK
|
|
64
|
+
int_lit : NEGATIVE_DECIMAL? DECIMAL+ | NEGATIVE_DECIMAL+
|
|
65
|
+
!float_lit: (NEGATIVE_DECIMAL? DECIMAL+ | NEGATIVE_DECIMAL+) "." DECIMAL+ (EXP_MARK)?
|
|
66
|
+
| (NEGATIVE_DECIMAL? DECIMAL+ | NEGATIVE_DECIMAL+) ("." DECIMAL+)? (EXP_MARK)
|
|
67
|
+
NEGATIVE_DECIMAL : "-" DECIMAL
|
|
67
68
|
DECIMAL : "0".."9"
|
|
68
|
-
EXP_MARK : ("e" | "E") ("+" | "-")?
|
|
69
|
+
EXP_MARK : ("e" | "E") ("+" | "-")? DECIMAL+
|
|
69
70
|
EQ : /[ \t]*=(?!=|>)/
|
|
70
71
|
|
|
71
72
|
tuple : "[" (new_line_or_comment* expression new_line_or_comment* ",")* (new_line_or_comment* expression)? new_line_or_comment* "]"
|
|
@@ -30,6 +30,10 @@ class DictTransformer(Transformer):
|
|
|
30
30
|
|
|
31
31
|
with_meta: bool
|
|
32
32
|
|
|
33
|
+
@staticmethod
|
|
34
|
+
def is_type_keyword(value: str) -> bool:
|
|
35
|
+
return value in {"bool", "number", "string"}
|
|
36
|
+
|
|
33
37
|
def __init__(self, with_meta: bool = False):
|
|
34
38
|
"""
|
|
35
39
|
:param with_meta: If set to true then adds `__start_line__` and `__end_line__`
|
|
@@ -301,6 +305,10 @@ class DictTransformer(Transformer):
|
|
|
301
305
|
if value.startswith('"') and value.endswith('"'):
|
|
302
306
|
value = str(value)[1:-1]
|
|
303
307
|
return self.process_escape_sequences(value)
|
|
308
|
+
|
|
309
|
+
if self.is_type_keyword(value):
|
|
310
|
+
return value
|
|
311
|
+
|
|
304
312
|
return f"${{{value}}}"
|
|
305
313
|
return value
|
|
306
314
|
|
|
@@ -341,8 +349,10 @@ class DictTransformer(Transformer):
|
|
|
341
349
|
return "true" if value else "false"
|
|
342
350
|
if isinstance(value, str):
|
|
343
351
|
return value
|
|
344
|
-
if isinstance(value, int):
|
|
352
|
+
if isinstance(value, (int, float)):
|
|
345
353
|
return str(value)
|
|
354
|
+
if value is None:
|
|
355
|
+
return "None"
|
|
346
356
|
|
|
347
357
|
raise RuntimeError(f"Invalid type to convert to inline HCL: {type(value)}")
|
|
348
358
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|