diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0720470ea..95d38d83d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,51 +1,39 @@ default_stages: [commit] repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: requirements-txt-fixer + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/psf/black rev: 22.8.0 hooks: - id: black - args: [".", "--check"] - files: $(git diff --name-only --cached --diff-filter=ACMR) - - # hooks: - # - id: changes-files - # language: bash - - # - repo: https://github.com/pre-commit/pre-commit-hooks - # rev: v3.2.0 - # hooks: - # - id: requirements-txt-fixer - # - id: check-yaml - # - id: end-of-file-fixer - # - id: trailing-whitespace - - # - repo: https://github.com/psf/black - # rev: 22.8.0 - # hooks: - # - id: black - # args: ['.', "--check"] - # # files: + name: black formatting + entry: bash -c 'black $(git diff --name-only --cached --diff-filter=ACMR | grep .py)' - # - repo: https://github.com/pycqa/isort - # rev: 5.10.1 - # hooks: - # - id: isort - # name: isort (python) - # args: ['--filter-files', '.'] - # entry: isort - - # - repo: https://github.com/pycqa/flake8 - # rev: 5.0.4 - # hooks: - # - id: flake8 - # args: ['--config=.flake8', '.'] + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + name: isort (python) + entry: bash -c 'isort $(git diff --name-only --cached --diff-filter=ACMR | grep .py)' + - repo: https://github.com/pycqa/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + name: flake8 format check + entry: bash -c 'flake8 --config=.flake8 $(git diff --name-only --cached --diff-filter=ACMR | grep .py)' - # - repo: local - # hooks: - # - id: jira-ticket - # name: check for jira ticket - # language: pygrep - # entry: '\A(?!ANPL+-[0-9]+)' - # args: [--multiline] - # stages: [commit-msg] + - repo: local + hooks: + - id: jira-ticket + name: check for jira ticket + language: pygrep + entry: '\A(?!ANPL+-[0-9]+)' + args: [--multiline] + stages: [commit-msg] diff --git a/controlpanel/settings/test.py b/controlpanel/settings/test.py index a60878b47..94063ad68 100644 --- a/controlpanel/settings/test.py +++ b/controlpanel/settings/test.py @@ -1,28 +1,29 @@ +# First-party/Local from controlpanel.settings.common import * -ENV = 'test' +ENV = "test" AWS_COMPUTE_ACCOUNT_ID = "test_compute_account_id" AWS_DATA_ACCOUNT_ID = "123456789012" # XXX DO NOT CHANGE - it will break moto tests K8S_WORKER_ROLE_NAME = "nodes.example.com" SAML_PROVIDER = "test-saml" -LOGGING["loggers"]["django_structlog"]["level"] = "WARNING" -LOGGING["loggers"]["controlpanel"]["level"] = "WARNING" +LOGGING["loggers"]["django_structlog"]["level"] = "WARNING" # noqa: F405 +LOGGING["loggers"]["controlpanel"]["level"] = "WARNING" # noqa: F405 AUTHENTICATION_BACKENDS = [ - 'rules.permissions.ObjectPermissionBackend', - 'django.contrib.auth.backends.ModelBackend', + "rules.permissions.ObjectPermissionBackend", + "django.contrib.auth.backends.ModelBackend", ] -MIDDLEWARE.remove('mozilla_django_oidc.middleware.SessionRefresh') -REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'].remove( - 'mozilla_django_oidc.contrib.drf.OIDCAuthentication', +MIDDLEWARE.remove("mozilla_django_oidc.middleware.SessionRefresh") # noqa: F405 +REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"].remove( # noqa: F405 + "mozilla_django_oidc.contrib.drf.OIDCAuthentication", ) OIDC_OP_JWKS_ENDPOINT = "https://example.com/.well-known/jwks.json" OIDC_ALLOW_UNSECURED_JWT = True OIDC_DOMAIN = "oidc.idp.example.com" -TOOLS_DOMAIN = 'example.com' +TOOLS_DOMAIN = "example.com" CSRF_COOKIE_SECURE = False SESSION_COOKIE_SECURE = False @@ -30,4 +31,4 @@ SLACK = { "api_token": "test-slack-api-token", "channel": "test-slack-channel", -} \ No newline at end of file +}