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: 25.12.0
hooks:
- id: black

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

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.9.2
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: 7.0.0
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/rtts/djhtml
rev: 3.0.6
rev: 3.0.10
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.4
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."""
1 change: 1 addition & 0 deletions 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 Down
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base settings to build other settings files upon."""

from pathlib import Path

import environ
Expand Down
1 change: 1 addition & 0 deletions config/settings/local.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define your local settings here."""

# pylint: disable=W0401,W0614
from .base import * # noqa
from .base import env
Expand Down
1 change: 1 addition & 0 deletions 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 Down
1 change: 1 addition & 0 deletions config/settings/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""With these settings, tests run faster."""

# pylint: disable=wildcard-import,unused-wildcard-import
from .base import * # noqa
from .base import env
Expand Down
1 change: 1 addition & 0 deletions config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
middleware here, or combine a Django application with an application of another
framework.
"""

import os
import sys
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions merge_production_dotenvs_in_dotenv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Merge Environments in .env file."""

import os
from collections.abc import Sequence
from pathlib import Path
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
1 change: 1 addition & 0 deletions 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 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,4 +1,5 @@
"""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
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/tests/test_drf_urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your test for the DRF urls."""

import pytest
from django.urls import resolve, reverse

Expand Down
1 change: 1 addition & 0 deletions 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 Down
1 change: 1 addition & 0 deletions onebarangay_psql/announcement/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your announcement model tests here."""

import pytest

from onebarangay_psql.announcement.models import Announcement
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
1 change: 1 addition & 0 deletions 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 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 Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/tests/test_drf_urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your test for the appointment DRF urls."""

import pytest
from django.urls import resolve, reverse

Expand Down
1 change: 1 addition & 0 deletions 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 Down
1 change: 1 addition & 0 deletions 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 Down
1 change: 1 addition & 0 deletions onebarangay_psql/appointment/viewset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your appointment views here."""

from rest_framework import mixins, viewsets
from rest_framework.decorators import action
from rest_framework.permissions import IsAdminUser, IsAuthenticated
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/log/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Default init file for log package."""

from .views import prometheus_metrics # noqa: F401
1 change: 1 addition & 0 deletions onebarangay_psql/log/middleware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Page Views and Time Spent custom middleware for Prometheus."""

import time

from onebarangay_psql.utils.prometheus import PROM_GRAPHQL_REQUEST_TIME, PROM_PAGEVIEWS
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/log/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Views for Prometheus monitoring."""

from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from prometheus_client import CONTENT_TYPE_LATEST
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/rbi/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Register your rbi models here."""

from datetime import datetime

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

from django.apps import AppConfig


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

from zoneinfo import ZoneInfo

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

from auditlog.registry import auditlog
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/rbi/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your rbi serializers here."""

from rest_framework_json_api import serializers

from onebarangay_psql.rbi.models import FamilyMember, HouseRecord
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/rbi/tests/test_drf_http_methods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your rbi drf http methods tests here."""

import datetime
from zoneinfo import ZoneInfo

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

from django.urls import resolve
from rest_framework.reverse import reverse

Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/rbi/tests/test_drf_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your rbi drf viewsets test here."""

import pytest
from django.test import RequestFactory
from django.urls import reverse
Expand Down
1 change: 1 addition & 0 deletions onebarangay_psql/rbi/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your rbi model tests here."""

import datetime
from zoneinfo import ZoneInfo

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

from rest_framework import viewsets
from rest_framework.permissions import IsAdminUser

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

from adminactions import actions
from django.contrib import admin

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

from django.apps import AppConfig


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create your custom management commands here."""

import random
from datetime import date, datetime, timedelta
from pathlib import Path
Expand Down Expand Up @@ -143,7 +144,7 @@ def handle(self, *args, **kwargs):


def set_sequence(
model: Union[Appointment, Announcement, User, HouseRecord, FamilyMember]
model: Union[Appointment, Announcement, User, HouseRecord, FamilyMember],
) -> None:
"""Reset the id sequence of a table.

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

from django.db import models


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

from rest_framework_json_api import serializers

from onebarangay_psql.statistics import models
Expand Down
Loading
Loading