Add plugin cookiecutter

This commit is contained in:
Bilawal Hameed
2020-02-03 14:57:23 +01:00
parent a02a33d406
commit 3461527969
10 changed files with 23 additions and 0 deletions
@@ -0,0 +1,3 @@
{
"plugin_name": "Complexity"
}
@@ -0,0 +1,14 @@
import re
import sys
def validate(name, regex, error_message):
if not re.match(regex, name):
print(error_message % name)
# exits with status 1 to indicate failure
sys.exit(1)
validate('{{ cookiecutter.plugin_name }}',
r'^[a-z-]+$', 'ERROR: %s is not a valid plugin name! Only lowercase letters and hyphens are valid (Examples: my-amazing-plugin, myamazingplugin).')
@@ -0,0 +1 @@
{{cookiecutter.plugin_name}}
+5
View File
@@ -0,0 +1,5 @@
FROM python:3.8-slim
RUN pip install cookiecutter==1.7.0 --index-url https://pypi.python.org/simple
ENTRYPOINT [ "cookiecutter" ]