Skip to content

Commit

Permalink
add docs attributte to each file and for each variable
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Dec 22, 2023
1 parent 330dab2 commit ae5bd2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/envers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ def draft(
env_vars = dotenv_values(env_path)
file_spec = {
"type": "dotenv",
"docs": "",
"vars": {
var: {
"type": "string",
"docs": "",
"default": value,
}
for var, value in env_vars.items()
Expand Down
10 changes: 8 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
def spec_v1():
"""Return dummy data for spec v1."""
return {
"status": "draft",
"docs": "",
"status": "draft",
"profiles": ["base"],
"spec": {
"files": {
".env": {
"docs": "",
"type": "dotenv",
"vars": {
"var": {
"docs": "",
"type": "string",
"default": "hello",
}
Expand Down Expand Up @@ -63,8 +65,8 @@ def test_draft(self):
"version": "0.1",
"releases": {
spec_version: {
"status": "draft",
"docs": "",
"status": "draft",
"profiles": ["base"],
"spec": {"files": {}},
}
Expand Down Expand Up @@ -161,9 +163,11 @@ def test_draft_from_multi_env(self, spec_v1):

spec_files = expected_data["releases"][v1]["spec"]["files"]
spec_files[env_path_1] = {
"docs": "",
"type": "dotenv",
"vars": {
"var1": {
"docs": "",
"type": "string",
"default": "hello1",
}
Expand All @@ -181,9 +185,11 @@ def test_draft_from_multi_env(self, spec_v1):

spec_files = expected_data["releases"][v1]["spec"]["files"]
spec_files[env_path_2] = {
"docs": "",
"type": "dotenv",
"vars": {
"var2": {
"docs": "",
"type": "string",
"default": "hello2",
}
Expand Down

0 comments on commit ae5bd2c

Please sign in to comment.