chore(boilerplate): Initialize

This commit is contained in:
2025-09-18 10:53:53 +02:00
parent 7247304555
commit af72a43e0b
17 changed files with 32 additions and 110 deletions

1
.gitea/CODEOWNERS Normal file
View File

@@ -0,0 +1 @@
* @inholland

View File

@@ -1,20 +1,20 @@
# Contributing
If you wish to contribute to {{project.name}}, feel free to fork the repository and submit a pull request.
{{project.linter}} is enforced to correct most typo's you make and keep the code style the same throughout the whole project,
so it would be much appreciated if you installed {{project.linter}} to your editor of choice
If you wish to contribute to ros2-assignments, feel free to fork the repository and submit a pull request.
sonarqube is enforced to correct most typo's you make and keep the code style the same throughout the whole project,
so it would be much appreciated if you installed sonarqube to your editor of choice
## Prerequisites
The following prerequisites must be met before installing {{project.name}}:
{{setup.prerequisites}}
The following prerequisites must be met before installing ros2-assignments:
editorconfig
## Setup
To get ready to work on the codebase, please do the following:
1. Fork & clone the repository, and make sure you are on the **master** branch
2. Run {{setup.install}}
3. Code your ideas and test them using {{setup.test}}
4. [Submit a pull request](https://github.com/{{project.master}}/{{project.name}}/compare)
2. Run
3. Code your ideas and test them using
4. [Submit a pull request](https://github.com/inholland/ros2-assignments/compare)
## Testing
When creating any new functions, please also create unit tests for them in the `tests` directory.

2
.gitea/FUNDING.yml Normal file
View File

@@ -0,0 +1,2 @@
{}

View File

@@ -6,7 +6,8 @@ body:
id: package
attributes:
label: Which part is this bug report for?
options: {{tree.parts}}
options: ['']
validations:
required: true
- type: textarea
@@ -26,7 +27,7 @@ body:
attributes:
label: Code sample
description: Include a reproducible, minimal code sample. This will be automatically formatted into code, so no need for backticks.
render: {{project.lang}}
render: cpp
placeholder: |
Your code sample should be...
... Minimal - Use as little code as possible that still produces the same problem (and is understandable)
@@ -42,9 +43,9 @@ body:
- type: input
id: lang-version
attributes:
label: '{{project.lang}} version'
label: 'cpp version'
description: |
Which version of {{project.lang}} are you using?
Which version of cpp are you using?
validations:
required: true
- type: input

View File

@@ -0,0 +1,6 @@
blank_issues_enabled: false
contact_links:
- about: E-mail
name: email
url: contact@wessel.gg

View File

@@ -10,7 +10,8 @@ body:
id: package
attributes:
label: Which part is this feature request for?
options: {{tree.parts}}
options: ['']
validations:
required: false
- type: textarea

View File

@@ -1,6 +1,6 @@
---
name: Pull Request
about: Propose changes to {{project.name}}
about: Propose changes to ros2-assignments
title: "[PR] Your changes"
labels: pullrequest
---
@@ -12,6 +12,6 @@ labels: pullrequest
- [ ] Code changes have been tested and there aren't any typos in it
**Semantic versioning classification:**
- [ ] This PR changes {{project.name}} core codebase (methods or parameters added)
- [ ] This PR changes ros2-assignments core codebase (methods or parameters added)
- [ ] This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
- [ ] This PR **only** includes non-code changes, like changes to documentation, README, etc.

View File

@@ -1,4 +1,5 @@
addReviewers: true
reviewers: {{project.reviewers}}
reviewers: [wessel]
numberOfReviewers: 0
runOnDraft: true

1
.github/CODEOWNERS vendored
View File

@@ -1 +0,0 @@
* @{{project.master}}

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
{{project.funding}}

View File

@@ -1,2 +0,0 @@
blank_issues_enabled: false
{{project.contact}}

View File

@@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) {{project.license}}
Copyright (c) 2025 Wessel T <contact@wessel.gg>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,11 +1,11 @@
<img src="{{project.logo}}" align="left" width="192px" height="192px"/>
<img src="https://wessel.gg/static/img/logo-gradient.svg" align="left" width="192px" height="192px"/>
<img align="left" width="0" height="192px" hspace="10"/>
> {{project.name}}
> ros2-assignments
[![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](/LICENSE)
{{info.desc}}
Assignments made for the first semester of ROS2
<br><br>

View File

@@ -1,86 +0,0 @@
import os
import yaml
import re
import datetime
file_types = ['LICENSE', 'CODEOWNERS', '.md', '.yml']
script_name = os.path.basename(__file__)
def replace_placeholders(file_path, replacements):
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
for placeholder, replacement in replacements.items():
content = re.sub(re.escape(placeholder), replacement, content)
with open(file_path, 'w', encoding='utf-8') as file:
file.write(content)
def initialize_repository(directory, replacements):
for root, _, files in os.walk(directory):
for file in files:
if file == script_name:
continue
if any(file.endswith(file_type) for file_type in file_types):
file_path = os.path.join(root, file)
replace_placeholders(file_path, replacements)
def parse_input(prompt):
return [item.strip() for item in input(prompt).split(',')]
def parse_contact(prompt):
contacts = []
while True:
print(prompt)
name = input(f"\tName\t\t").strip()
if not name:
break
url = input(f"\tURL\t\t").strip()
about = input(f"\tAbout\t\t").strip()
contacts.append({'name': name, 'url': url, 'about': about})
return {'contact_links': contacts}
def parse_funding(prompt):
funding = {}
while True:
print(prompt)
key = input(f"\tKey\t\t").strip()
if not key:
break
value = input(f"\tValue\t\t").strip()
funding[key] = value
return funding
def main():
current_year = str(datetime.datetime.now().year)
replacements = {
"{{project.name}}": input("Project name\t\t"),
"{{info.desc}}": input("Project Description\t"),
"{{project.master}}": input("Master of the repo\t"),
"{{project.license}}": f"{current_year} " + input('License holder\t\t'),
"{{tree.parts}}": yaml.dump(parse_input("Parts of the repo\t"), default_flow_style=True),
"{{project.lang}}": input("Language used\t\t"),
"{{project.linter}}": input("Linter used\t\t"),
"{{setup.prerequisites}}": input("Prerequisites\t\t"),
"{{setup.install}}": input("Install command\t\t"),
"{{setup.test}}": input("Test command\t\t"),
"{{project.logo}}": input("Project logo URL\t"),
"{{project.funding}}": yaml.dump(parse_funding("Funding methods\t\t"), default_flow_style=True),
"{{project.contact}}": yaml.dump(parse_contact("Contact information\t"), default_flow_style=False),
"{{project.reviewers}}": yaml.dump(parse_input("Auto-assign users (x,y)\t"), default_flow_style=True)
}
directory = input("Initialize directory\t") or '.'
initialize_repository(directory, replacements)
delete = input("Delete this script? (Y/n)\t") or "y"
if delete.lower() == "y":
os.remove(__file__)
if __name__ == "__main__":
main()