Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

chore: add reserved keywords linter #521

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ help: ## display this help message
@echo "Please use \`make <target>' where <target> 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
Expand Down Expand Up @@ -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
11 changes: 11 additions & 0 deletions db_keyword_overrides.yml
Original file line number Diff line number Diff line change
@@ -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: