diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac99c887..c32b12eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - ubuntu-20.04 python-version: - 3.8 - targets: [ 'quality','main.test','docs' ] + targets: [ 'quality','main.test','docs','check_keywords'] steps: - uses: actions/checkout@v1 diff --git a/Makefile b/Makefile index b5be41a7..cd40a68f 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ help: ## display this help message @echo "Please use \`make ' where is one of" @perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' -.PHONY: requirements develop clean diff.report view.diff.report quality static docs +.PHONY: requirements develop clean diff.report view.diff.report quality static docs check_keywords requirements: ## install base requirements pip3 install -q -r requirements/base.txt @@ -150,3 +150,6 @@ docker_push: docker_tag docker_auth ## push to docker hub docs: tox.requirements tox -e docs + +check_keywords: ## Scan the Django models in all installed apps in this project for restricted field names + python manage.py check_reserved_keywords --override_file db_keyword_overrides.yml diff --git a/db_keyword_overrides.yml b/db_keyword_overrides.yml new file mode 100644 index 00000000..0b3e7df5 --- /dev/null +++ b/db_keyword_overrides.yml @@ -0,0 +1,11 @@ +# This file is used by the 'check_reserved_keywords' management command to allow specific field names to be overridden +# when checking for conflicts with lists of restricted keywords used in various database/data warehouse tools. +# For more information, see: https://github.com/edx/edx-django-release-util/release_util/management/commands/check_reserved_keywords.py +# +# overrides should be added in the following format: +# - ModelName.field_name +--- +MYSQL: + - Token.key +SNOWFLAKE: +STITCH: