Skip to content

Commit 023cbf1

Browse files
committed
cookiecutter: Fix adding of an empty keyword
When pressing ENTER while being asked for project keywords, an empty keyword ("") was added. This commit fixes that. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 0edcd9a commit 023cbf1

File tree

7 files changed

+8
-6
lines changed

7 files changed

+8
-6
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@
6565
### Cookiecutter template
6666

6767
- Now the CI workflow will checkout the submodules.
68+
69+
- Fix adding of an empty keyword.

cookiecutter/local_extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def keywords(cookiecutter: dict[str, str]) -> str:
172172
cookiecutter_keywords = cookiecutter["keywords"]
173173
if cookiecutter_keywords == default:
174174
cookiecutter_keywords = ""
175-
extended_keywords.extend(k.strip() for k in cookiecutter_keywords.split(","))
175+
extended_keywords.extend(k.strip() for k in cookiecutter_keywords.split(",") if k)
176176
return _json.dumps(extended_keywords)
177177

178178

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name = "frequenz-actor-test"
1414
description = "Test description"
1515
readme = "README.md"
1616
license = { text = "MIT" }
17-
keywords = ["frequenz", "python", "actor", "test", ""]
17+
keywords = ["frequenz", "python", "actor", "test"]
1818
classifiers = [ # TODO(cookiecutter): Remove and add more if appropriate
1919
"Development Status :: 3 - Alpha",
2020
"Intended Audience :: Developers",

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name = "frequenz-api-test"
1414
description = "Test description"
1515
readme = "README.md"
1616
license = { text = "MIT" }
17-
keywords = ["frequenz", "python", "api", "grpc", "protobuf", "rpc", "test", ""]
17+
keywords = ["frequenz", "python", "api", "grpc", "protobuf", "rpc", "test"]
1818
classifiers = [ # TODO(cookiecutter): Remove and add more if appropriate
1919
"Development Status :: 3 - Alpha",
2020
"Intended Audience :: Developers",

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name = "frequenz-app-test"
1414
description = "Test description"
1515
readme = "README.md"
1616
license = { text = "MIT" }
17-
keywords = ["frequenz", "python", "app", "application", "test", ""]
17+
keywords = ["frequenz", "python", "app", "application", "test"]
1818
classifiers = [ # TODO(cookiecutter): Remove and add more if appropriate
1919
"Development Status :: 3 - Alpha",
2020
"Intended Audience :: Developers",

tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name = "frequenz-test"
1414
description = "Test description"
1515
readme = "README.md"
1616
license = { text = "MIT" }
17-
keywords = ["frequenz", "python", "lib", "library", "test", ""]
17+
keywords = ["frequenz", "python", "lib", "library", "test"]
1818
classifiers = [ # TODO(cookiecutter): Remove and add more if appropriate
1919
"Development Status :: 3 - Alpha",
2020
"Intended Audience :: Developers",

tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name = "frequenz-model-test"
1414
description = "Test description"
1515
readme = "README.md"
1616
license = { text = "MIT" }
17-
keywords = ["frequenz", "python", "model", "ai", "ml", "machine-learning", "test", ""]
17+
keywords = ["frequenz", "python", "model", "ai", "ml", "machine-learning", "test"]
1818
classifiers = [ # TODO(cookiecutter): Remove and add more if appropriate
1919
"Development Status :: 3 - Alpha",
2020
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)