chore(boilerplate): Initialize

This commit is contained in:
2025-09-03 09:40:11 +02:00
committed by Wessel Tip
parent 4c25561d5b
commit 913ef3f0ac
11 changed files with 31 additions and 109 deletions

2
.github/CODEOWNERS vendored
View File

@@ -1 +1 @@
* @{{project.master}} * @wessel

View File

@@ -1,20 +1,20 @@
# Contributing # Contributing
If you wish to contribute to {{project.name}}, feel free to fork the repository and submit a pull request. If you wish to contribute to InHolland ROS2, 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, 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 {{project.linter}} to your editor of choice so it would be much appreciated if you installed sonarqube to your editor of choice
## Prerequisites ## Prerequisites
The following prerequisites must be met before installing {{project.name}}: The following prerequisites must be met before installing InHolland ROS2:
{{setup.prerequisites}}
## Setup ## Setup
To get ready to work on the codebase, please do the following: 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 1. Fork & clone the repository, and make sure you are on the **master** branch
2. Run {{setup.install}} 2. Run
3. Code your ideas and test them using {{setup.test}} 3. Code your ideas and test them using
4. [Submit a pull request](https://github.com/{{project.master}}/{{project.name}}/compare) 4. [Submit a pull request](https://github.com/wessel/InHolland ROS2/compare)
## Testing ## Testing
When creating any new functions, please also create unit tests for them in the `tests` directory. When creating any new functions, please also create unit tests for them in the `tests` directory.

3
.github/FUNDING.yml vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
The MIT License (MIT) 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal 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"/> <img align="left" width="0" height="192px" hspace="10"/>
> {{project.name}} > InHolland ROS2
[![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](/LICENSE) [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](/LICENSE)
{{info.desc}} Minor Embedded Systems ROS2 Project
<br><br> <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()