From df0b2cac3f957a13c206bbf344dd28aa17888efb Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 20 Dec 2021 09:39:23 +0000 Subject: [PATCH] Add a PyCharm run configuration for docker-compose (#3462) Co-authored-by: Pavel Karateev --- .editorconfig | 2 +- hooks/post_gen_project.py | 4 ++++ {{cookiecutter.project_slug}}/.editorconfig | 2 +- .../docker_compose_up_django.xml | 23 +++++++++++++++++++ .../docker_compose_up_docs.xml | 16 +++++++++++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml create mode 100644 {{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_docs.xml diff --git a/.editorconfig b/.editorconfig index 26140706..6a9a5c45 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ trim_trailing_whitespace = true indent_style = space indent_size = 4 -[*.{html,css,scss,json,yml}] +[*.{html,css,scss,json,yml,xml}] indent_style = space indent_size = 2 diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 61b75949..50fcbea2 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -61,6 +61,10 @@ def remove_docker_files(): file_names = ["local.yml", "production.yml", ".dockerignore"] for file_name in file_names: os.remove(file_name) + if "{{ cookiecutter.use_pycharm }}".lower() == "y": + file_names = ["docker_compose_up_django.xml", "docker_compose_up_docs.xml"] + for file_name in file_names: + os.remove(os.path.join(".idea", "runConfigurations", file_name)) def remove_utility_files(): diff --git a/{{cookiecutter.project_slug}}/.editorconfig b/{{cookiecutter.project_slug}}/.editorconfig index 26140706..6a9a5c45 100644 --- a/{{cookiecutter.project_slug}}/.editorconfig +++ b/{{cookiecutter.project_slug}}/.editorconfig @@ -12,7 +12,7 @@ trim_trailing_whitespace = true indent_style = space indent_size = 4 -[*.{html,css,scss,json,yml}] +[*.{html,css,scss,json,yml,xml}] indent_style = space indent_size = 2 diff --git a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml new file mode 100644 index 00000000..67f369a3 --- /dev/null +++ b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_docs.xml b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_docs.xml new file mode 100644 index 00000000..0f77b28d --- /dev/null +++ b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_docs.xml @@ -0,0 +1,16 @@ + + + + + + + + + +