Skip to content

Commit 1ed4a37

Browse files
authored
Add untestable reason and info about naming convention (#27)
* Add untestable reason and info about naming convention * Don't display glotter2 info for untestable
1 parent aff72ce commit 1ed4a37

File tree

3 files changed

+53
-41
lines changed

3 files changed

+53
-41
lines changed

poetry.lock

Lines changed: 10 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[tool.poetry]
33
name = "ronbun"
44
description = "The Sample Programs README Automation Tool"
5-
version = "0.7.4"
5+
version = "0.8.0"
66
license = "MIT"
77

88
authors = [
@@ -14,16 +14,15 @@ homepage = "https://therenegadecoder.com"
1414
repository = "https://github.com/TheRenegadeCoder/sample-programs-readmes"
1515

1616
classifiers=[
17-
"Programming Language :: Python :: 3.9",
1817
"Operating System :: OS Independent",
1918
"Development Status :: 5 - Production/Stable",
2019
"License :: OSI Approved :: MIT License"
2120
]
2221

2322
[tool.poetry.dependencies]
2423
python = "^3.8"
25-
snakemd = "^2.2.0b1"
26-
subete = "^0.16"
24+
snakemd = "^2.2.0"
25+
subete = "^0.18.0"
2726

2827
[tool.poetry.group.test.dependencies]
2928
coverage = "^7.2"

ronbun/readme.py

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import annotations
12
import argparse
23
import logging
34
import ssl
@@ -12,6 +13,13 @@
1213

1314
issue_url_template_base = "https://github.com/TheRenegadeCoder/sample-programs/issues/new"
1415
issue_url_template_query = "?assignees=&labels=enhancement,{label}&template=code-snippet-request.md&title=Add+{project}+in+{language}"
16+
naming_conventions = {
17+
"camel": "helloWorld",
18+
"hyphen": "hello-world",
19+
"lower": "helloworld",
20+
"pascal": "HelloWorld",
21+
"underscore": "hello_world"
22+
}
1523

1624

1725
def main():
@@ -207,24 +215,46 @@ def _build_readme(self, language: LanguageCollection) -> None:
207215
# Testing
208216
page.add_heading("Testing", level=2)
209217
test_data = language.testinfo()
210-
if not test_data:
218+
untestable_data = language.untestable_info()
219+
if test_data:
220+
extension = test_data["folder"]["extension"]
221+
naming = test_data["folder"]["naming"]
211222
page.add_paragraph(
212-
"""
213-
This language currently does not feature testing. If you'd like to help in the efforts to test all of
214-
the code in this repo, consider creating a testinfo.yml file with the following information:
215-
"""
223+
f"The following list shares details about how we name all Sample Programs in {language}:"
216224
)
217-
page.add_code("folder:\n extension:\n naming:\n\ncontainer:\n image:\n tag:\n cmd:", lang="yml")
218-
else:
225+
page.add_unordered_list([
226+
f"Extension: {extension}",
227+
f"Naming Convention: {naming}"
228+
])
229+
230+
page.add_paragraph('For example, the "Hello World" sample would be named this:')
231+
page.add_unordered_list([f"{naming_conventions[naming]}{extension}"])
232+
219233
page.add_paragraph(
220-
f"The following list shares details about what we're using to test all Sample Programs in {language}."
234+
f"The following list shares details about what we're using to test all Sample Programs in {language}:"
221235
)
222236
page.add_unordered_list([
223237
f"Docker Image: {test_data['container']['image']}",
224238
f"Docker Tag: {test_data['container']['tag']}"
225239
])
226-
glotter = page.add_paragraph("See the Glotter2 project for more information on how to create a testinfo file.")
227-
glotter.insert_link("Glotter2 project", "https://github.com/rzuckerm/glotter2")
240+
elif untestable_data:
241+
page.add_paragraph(
242+
f"{language} cannot be tested for the following reason:"
243+
)
244+
page.add_unordered_list([untestable_data[0]["reason"]])
245+
else:
246+
page.add_paragraph(
247+
"""
248+
This language currently does not feature testing. If you'd like to help in the efforts to test all of
249+
the code in this repo, consider creating a testinfo.yml file with the following information:
250+
"""
251+
)
252+
page.add_code("folder:\n extension:\n naming:\n\ncontainer:\n image:\n tag:\n cmd:", lang="yml")
253+
254+
if not untestable_data:
255+
glotter = page.add_paragraph("See the Glotter2 project for more information on how to create a testinfo file.")
256+
glotter.insert_link("Glotter2 project", "https://github.com/rzuckerm/glotter2")
257+
228258
page.add_horizontal_rule()
229259
page.add_block(_generate_credit())
230260

0 commit comments

Comments
 (0)