From ca3adb00ceeb9382e7bf5636f42a40eef4bc1f05 Mon Sep 17 00:00:00 2001 From: Julien Riou Date: Thu, 26 Nov 2020 15:23:52 +0100 Subject: [PATCH] Add a contribution/lint guide Signed-off-by: Julien Riou --- Dockerfile | 5 +++++ README.md | 13 +++++++++++++ TODO.txt | 1 - 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3629d9a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.8-slim +RUN apt-get update \ + && apt-get install -y git \ + && apt-get autoclean \ + && pip install pre-commit diff --git a/README.md b/README.md index bc78816..11ae720 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,16 @@ Variables replaced in the service template: * `service_state` (= `$SERVICESTATE$`) * `long_date_time` (= `$LONGDATETIME$`) * `service_output` (= `$SERVICEOUTPUT$`) + +## How to contribute + +Contributions are welcomed! Feel free to update the code and create a pull-request. + +Be sure to lint the code before: +``` +docker build -t pre-commit . +docker run -it -v $(pwd):/mnt/ --rm pre-commit bash +# cd /mnt/ +# pre-commit run --all-files +# exit +``` diff --git a/TODO.txt b/TODO.txt index da36fd8..06b3974 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,2 +1 @@ -Add pre-commit Dockerfile and a doc to easily lint the code Add requirements.txt file