Skip to content
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
26 changes: 13 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
exclude: "^docs/|/migrations/"
default_stages: [commit]
default_stages: [pre-commit]
default_language_version:
python: python3.10

Expand All @@ -17,7 +17,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -31,33 +31,33 @@ repos:
- id: check-executables-have-shebangs
- id: check-merge-conflict

- repo: https://github.com/psf/black
rev: 23.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.30.0
rev: v1.38.0
hooks:
- id: yamllint
args: [ --format, parsable, --strict ]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.9.4
hooks:
- id: bandit
args: ['-iii', '-ll', '-s', 'B404', 'B602', 'B603', 'B607']
language_version: python3.10
exclude: ^test/

- repo: https://github.com/PyCQA/docformatter
rev: v1.5.1
rev: v1.7.7
hooks:
- id: docformatter
args: [ --in-place, --wrap-summaries=115, --wrap-descriptions=120 ]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.3.0
hooks:
- id: flake8
args: ["--config=setup.cfg"]
Expand All @@ -73,13 +73,13 @@ repos:
]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 8.0.1
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/rtts/djhtml
rev: 3.0.6
rev: 3.0.11
hooks:
- id: djhtml

Expand All @@ -90,7 +90,7 @@ repos:
additional_dependencies: ["toml"]

- repo: https://github.com/pycqa/pylint
rev: v2.17.1
rev: v4.0.5
hooks:
- id: pylint
exclude: |
Expand Down Expand Up @@ -127,7 +127,7 @@ repos:
- djangorestframework-jsonapi

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v1.19.1
hooks:
- id: mypy
exclude: "[a-zA-Z]*/(migrations)/(.)*"
Expand Down Expand Up @@ -159,7 +159,7 @@ repos:
]

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.21.2
hooks:
- id: pyupgrade
args: [ "--py36-plus", "--py37-plus", "--py38-plus", "--py39-plus" ]
2 changes: 1 addition & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""init placeholders for config."""
"""Init placeholders for config."""
2 changes: 1 addition & 1 deletion config/api_router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your user API router here."""

from django.conf import settings
from rest_framework.routers import BaseRouter, DefaultRouter, SimpleRouter

Expand All @@ -13,7 +14,6 @@
UserViewSet,
)


router = BaseRouter()

if settings.DEBUG:
Expand Down
2 changes: 1 addition & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Base settings to build other settings files upon."""

from pathlib import Path

import environ


ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# onebarangay_psql/
APPS_DIR = ROOT_DIR / "onebarangay_psql"
Expand Down
2 changes: 1 addition & 1 deletion config/settings/local.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Define your local settings here."""

# pylint: disable=W0401,W0614
from .base import * # noqa
from .base import env


# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
Expand Down
2 changes: 1 addition & 1 deletion config/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define your production settings here."""

import logging

import sentry_sdk
Expand All @@ -10,7 +11,6 @@
from .base import * # noqa
from .base import env


# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
Expand Down
2 changes: 1 addition & 1 deletion config/settings/test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""With these settings, tests run faster."""

# pylint: disable=wildcard-import,unused-wildcard-import
from .base import * # noqa
from .base import env


# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
Expand Down
2 changes: 1 addition & 1 deletion config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
middleware here, or combine a Django application with an application of another
framework.
"""

import os
import sys
from pathlib import Path

from django.core.wsgi import get_wsgi_application


# This allows easy placement of apps within the interior
# onebarangay_psql directory.
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent
Expand Down
2 changes: 1 addition & 1 deletion merge_production_dotenvs_in_dotenv.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Merge Environments in .env file."""

import os
from collections.abc import Sequence
from pathlib import Path

import pytest


ROOT_DIR_PATH = Path(__file__).parent.resolve()
PRODUCTION_DOTENVS_DIR_PATH = ROOT_DIR_PATH / ".envs" / ".production"
PRODUCTION_DOTENV_FILE_PATHS = [
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""INIT file for module onebarangay_psql."""

__version__ = "0.1.0"
__version_info__ = tuple(
int(num) if num.isdigit() else num
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Register your announcement models here."""

from django.contrib import admin
from django.utils.html import strip_tags
from import_export import resources
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your app config for announcement apps."""

import contextlib

from django.apps import AppConfig
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement factories here."""

import factory
from django.utils.text import slugify
from factory import Faker
Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/announcement/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement models here."""

from auditlog.registry import auditlog
from django.contrib.auth import get_user_model
from django.db import models
Expand All @@ -8,7 +9,6 @@
from taggit.managers import TaggableManager
from tinymce.models import HTMLField


user = get_user_model()


Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/permission.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement permissions here."""

from rest_framework import permissions


Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/serializer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement serializer here."""

from rest_framework_json_api import serializers
from rest_framework_json_api.relations import HyperlinkedRelatedField
from taggit.serializers import TaggitSerializer, TagListSerializerField
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Create your announcement drf http methods tests here."""

from django.contrib.auth import get_user_model
from django.test.client import Client
from django.urls import reverse
from rest_framework import status

from onebarangay_psql.announcement.models import Announcement


User = get_user_model()


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/announcement/tests/test_drf_urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Create your test for the DRF urls."""

import pytest
from django.urls import resolve, reverse

from onebarangay_psql.announcement.models import Announcement


pytestmark = pytest.mark.django_db


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/announcement/tests/test_drf_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement drf viewset tests here."""

import pytest
from _pytest.fixtures import FixtureRequest
from django.test import RequestFactory
Expand All @@ -10,7 +11,6 @@
from onebarangay_psql.announcement.viewset import AnnouncementViewSet
from onebarangay_psql.users.models import User


pytestmark = pytest.mark.django_db


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/announcement/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Create your announcement model tests here."""

import pytest

from onebarangay_psql.announcement.models import Announcement
from onebarangay_psql.users.models import User


pytestmark = pytest.mark.django_db


Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/viewset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement views here."""

from django.utils.html import strip_tags
from push_notifications.models import GCMDevice
from rest_framework import viewsets
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Register your appointment models here."""

from django.contrib import admin
from import_export import resources
from import_export.admin import ImportExportModelAdmin
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment apps here."""

from django.apps import AppConfig


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/appointment/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment factories here."""

from zoneinfo import ZoneInfo

import factory
Expand All @@ -9,7 +10,6 @@
from onebarangay_psql.appointment.models import Appointment
from onebarangay_psql.users.factories import UserFactory


with open(APPS_DIR / "media/appointment/government_id/default.png", "rb") as f:
image = SimpleUploadedFile(f.name, f.read(), content_type="image/jpeg")

Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment models here."""

from datetime import timedelta

from auditlog.registry import auditlog
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/permissions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment permissions here."""

from rest_framework import permissions
from rest_framework.request import Request
from rest_framework.views import APIView
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/serializer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment serializer here."""

from rest_framework_json_api import serializers
from rest_framework_json_api.relations import HyperlinkedRelatedField

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment drf http methods tests here."""

from datetime import datetime
from zoneinfo import ZoneInfo

Expand All @@ -12,7 +13,6 @@
from config.settings.base import APPS_DIR
from onebarangay_psql.appointment.models import Appointment


User = get_user_model()


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/appointment/tests/test_drf_urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Create your test for the appointment DRF urls."""

import pytest
from django.urls import resolve, reverse

from onebarangay_psql.appointment.models import Appointment


pytestmark = pytest.mark.django_db


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/appointment/tests/test_drf_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment drf viewset tests here."""

from datetime import datetime
from zoneinfo import ZoneInfo

Expand All @@ -18,7 +19,6 @@
from onebarangay_psql.appointment.viewset import AppointmentViewSet, StatusUpdateViewSet
from onebarangay_psql.users.models import User


pytestmark = pytest.mark.django_db


Expand Down
2 changes: 1 addition & 1 deletion onebarangay_psql/appointment/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment model tests here."""

import zoneinfo
from datetime import datetime, timedelta

Expand All @@ -7,7 +8,6 @@
from onebarangay_psql.appointment.models import Appointment
from onebarangay_psql.users.models import User


pytestmark = pytest.mark.django_db


Expand Down
Loading
Loading