mirror of
https://github.com/Wessel/nhl-levenshtein.git
synced 2026-06-05 23:55:45 +02:00
chore: Initialize boilerplate
This commit is contained in:
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1 +1 @@
|
|||||||
* @{{project.master}}
|
* @wessel
|
||||||
|
|||||||
16
.github/CONTRIBUTING.md
vendored
16
.github/CONTRIBUTING.md
vendored
@@ -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 nhl-levenshtein, 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,
|
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 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 nhl-levenshtein:
|
||||||
{{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/nhl-levenshtein/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
3
.github/FUNDING.yml
vendored
@@ -1 +1,2 @@
|
|||||||
{{project.funding}}
|
{github: wessel}
|
||||||
|
|
||||||
|
|||||||
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -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: [haskell, csharp, typescript, report]
|
||||||
|
|
||||||
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: latex
|
||||||
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: 'latex version'
|
||||||
description: |
|
description: |
|
||||||
Which version of {{project.lang}} are you using?
|
Which version of latex are you using?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
|
|||||||
6
.github/ISSUE_TEMPLATE/config.yml
vendored
6
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -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
|
||||||
|
|
||||||
|
|||||||
3
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
3
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -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: [haskell, csharp, typescript, report]
|
||||||
|
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|||||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Pull Request
|
name: Pull Request
|
||||||
about: Propose changes to {{project.name}}
|
about: Propose changes to nhl-levenshtein
|
||||||
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 nhl-levenshtein 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.
|
||||||
|
|||||||
3
.github/auto_assign.yml
vendored
3
.github/auto_assign.yml
vendored
@@ -1,4 +1,5 @@
|
|||||||
addReviewers: true
|
addReviewers: true
|
||||||
reviewers: {{project.reviewers}}
|
reviewers: [wessel]
|
||||||
|
|
||||||
numberOfReviewers: 0
|
numberOfReviewers: 0
|
||||||
runOnDraft: true
|
runOnDraft: true
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) {{project.license}}
|
Copyright (c) 2025 Wessel Tip <contact@wessel.gg> (https://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
|
||||||
|
|||||||
@@ -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}}
|
> nhl-levenshtein
|
||||||
|
|
||||||
[](/LICENSE)
|
[](/LICENSE)
|
||||||
|
|
||||||
{{info.desc}}
|
A comparison of the Levenshtein ratio algorithm in Haskell, C# and TypeScript for NHL Stenden
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|||||||
86
init_repo.py
86
init_repo.py
@@ -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()
|
|
||||||
Reference in New Issue
Block a user