diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2f7a281 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 80 +trim_trailing_whitespace = true + +[*.{tf,tfvars}] +indent_size = 2 +indent_style = space + +[*.md] +max_line_length = 0 +trim_trailing_whitespace = false + +[COMMIT_EDITMSG] +max_line_length = 0 diff --git a/.gitignore b/.gitignore index 160fb72..d05a9b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode/ +.DS_Store .*.swp !.gitignore diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dda4b4e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +default_language_version: + # default language version for each language + python: python3.8 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + # See https://pre-commit.com/hooks.html for more hooks + #- id: check-added-large-files + - id: check-byte-order-marker + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-xml + - id: destroyed-symlinks + - id: detect-aws-credentials + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + # - id: pretty-format-json + # - id: check-yaml + - repo: https://github.com/gruntwork-io/pre-commit + rev: v0.1.17 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases + hooks: + - id: terraform-fmt + - id: helmlint + # - id: terraform-validate + # - id: terragrunt-hclfmt + # - id: tflint + # - id: shellcheck + # - id: yapf + # - id: markdown-link-check diff --git a/README.rst b/README.rst index 7b64df8..fe96859 100644 --- a/README.rst +++ b/README.rst @@ -111,4 +111,4 @@ This plugin was developed and open sourced to the community thanks to the genero License ------- -This software is licensed under the terms of the AGPLv3. \ No newline at end of file +This software is licensed under the terms of the AGPLv3. diff --git a/linter.sh b/linter.sh new file mode 100755 index 0000000..b8fe54c --- /dev/null +++ b/linter.sh @@ -0,0 +1,11 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# written by: mcdaniel +# https://lawrencemcdaniel.com +# +# date: mar-2022 +# +# usage: Runs terraform fmt -recursive +#------------------------------------------------------------------------------ + +pre-commit run --all-files diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..416634f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pre-commit diff --git a/tutorcredentials/patches/k8s-jobs b/tutorcredentials/patches/k8s-jobs index e394320..83dd50d 100644 --- a/tutorcredentials/patches/k8s-jobs +++ b/tutorcredentials/patches/k8s-jobs @@ -22,4 +22,4 @@ spec: volumes: - name: settings configMap: - name: credentials-settings \ No newline at end of file + name: credentials-settings diff --git a/tutorcredentials/patches/local-docker-compose-caddy-aliases b/tutorcredentials/patches/local-docker-compose-caddy-aliases index f7309a4..f2aabb1 100644 --- a/tutorcredentials/patches/local-docker-compose-caddy-aliases +++ b/tutorcredentials/patches/local-docker-compose-caddy-aliases @@ -1 +1 @@ -- {{ CREDENTIALS_HOST }} \ No newline at end of file +- {{ CREDENTIALS_HOST }} diff --git a/tutorcredentials/patches/local-docker-compose-dev-services b/tutorcredentials/patches/local-docker-compose-dev-services index 2840e06..e960ec8 100644 --- a/tutorcredentials/patches/local-docker-compose-dev-services +++ b/tutorcredentials/patches/local-docker-compose-dev-services @@ -12,4 +12,4 @@ credentials: networks: default: aliases: - - "{{ CREDENTIALS_HOST }}" \ No newline at end of file + - "{{ CREDENTIALS_HOST }}" diff --git a/tutorcredentials/patches/local-docker-compose-jobs-services b/tutorcredentials/patches/local-docker-compose-jobs-services index 0ad9f82..0dbdd4b 100644 --- a/tutorcredentials/patches/local-docker-compose-jobs-services +++ b/tutorcredentials/patches/local-docker-compose-jobs-services @@ -4,4 +4,4 @@ credentials-job: DJANGO_SETTINGS_MODULE: credentials.settings.tutor.production volumes: - ../plugins/credentials/apps/credentials/settings:/openedx/credentials/credentials/settings/tutor:ro - depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }} \ No newline at end of file + depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }} diff --git a/tutorcredentials/patches/openedx-lms-development-settings b/tutorcredentials/patches/openedx-lms-development-settings index 61ad3e8..fc4bb8a 100644 --- a/tutorcredentials/patches/openedx-lms-development-settings +++ b/tutorcredentials/patches/openedx-lms-development-settings @@ -1,2 +1,2 @@ CREDENTIALS_PUBLIC_URL_ROOT = "http://{{ CREDENTIALS_HOST }}:8150" -CREDENTIALS_API_URL = CREDENTIALS_PUBLIC_URL_ROOT + "/api/v2" \ No newline at end of file +CREDENTIALS_API_URL = CREDENTIALS_PUBLIC_URL_ROOT + "/api/v2" diff --git a/tutorcredentials/templates/credentials/apps/credentials/settings/partials/common.py b/tutorcredentials/templates/credentials/apps/credentials/settings/partials/common.py index 2cd17ef..849cfe5 100644 --- a/tutorcredentials/templates/credentials/apps/credentials/settings/partials/common.py +++ b/tutorcredentials/templates/credentials/apps/credentials/settings/partials/common.py @@ -93,4 +93,4 @@ for logger in LOGGING["loggers"].values(): if "local" in logger["handlers"]: logger["handlers"].remove("local") -{{ patch("credentials-settings-common") }} \ No newline at end of file +{{ patch("credentials-settings-common") }}