Skip to content
Merged
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 .dockleignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CIS-DI-0010
CIS-DI-0010
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

## その他・備考

- (備考やレビュワーへの申し送り事項等があれば書いてください)
- (備考やレビュワーへの申し送り事項等があれば書いてください)
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ migrations/

prof/*

.coverage*
.coverage*
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# pre-commit hooks for the d-party Backend (Django).
# Install: `pre-commit install` (run from this directory).
# Run on everything: `pre-commit run --all-files`
#
# ruff の詳細ルール(flake8 / flake8-django / flake8-bandit 等)は pyproject.toml の
# [tool.ruff] を参照する。
minimum_pre_commit_version: "3.5.0"

# ベンダー製 / 配信用静的アセット(jQuery・Bootstrap・Flickity 等の minified ライブラリ)は
# 整形対象から除外する。アプリのソースコードのみフックを適用する。
exclude: '^web/static/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.18
hooks:
# Lint(flake8 / flake8-django / flake8-bandit 等を ruff で再現。設定は pyproject.toml)
- id: ruff-check
args: [--fix]
# Format(black 互換)
- id: ruff-format
11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ line-length = 88
extend-exclude = ["**/migrations/*"]

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "DJ", "C4"]
# E,W,F = flake8 本体 (pycodestyle + pyflakes) / DJ = flake8-django /
# S = flake8-bandit / I = isort / UP = pyupgrade / B = flake8-bugbear /
# C4 = flake8-comprehensions
select = ["E", "W", "F", "I", "UP", "B", "DJ", "C4", "S"]
ignore = [
"E501", # line length is handled by the formatter
"B008", # function calls in argument defaults are idiomatic in Django/DRF
Expand All @@ -62,8 +65,10 @@ ignore = [
[tool.ruff.lint.per-file-ignores]
# The Channels ASGI entrypoint must initialise Django before importing routing.
"d_party/asgi.py" = ["E402"]
# Pre-existing test-only smells we intentionally leave untouched.
"**/tests.py" = ["E711", "E721", "E722", "F811", "F841"]
# Tests use bare asserts (flake8-bandit S101) plus pre-existing test-only smells.
"**/tests.py" = ["S101", "E711", "E721", "E722", "F811", "F841"]
"**/test_*.py" = ["S101"]
"conftest.py" = ["S101"]

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "d_party.settings"
Expand Down
2 changes: 1 addition & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!static/
!static/
2 changes: 1 addition & 1 deletion web/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block stylesheet %}
{% load static %}
<link rel="stylesheet" href="{% static "web/css/lobby.css" %}" />
{% endblock %}
{% endblock %}
{% block content %}
<div class="redirect-shop update-shop">
<img src="{% static "web/img/lobby/hand.svg" %}" width="125" height="125"/>
Expand Down
6 changes: 3 additions & 3 deletions web/templates/chart.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% extends "layout.html" %} {% load static %}
{%block stylesheet %} <script src="{% static "web/js/index.js" %}"></script>
{%block stylesheet %} <script src="{% static "web/js/index.js" %}"></script>
<script src="{% static "web/js/echarts.min.js" %}"></script>
<script src="{% static "web/js/dark.js" %}"></script>
<link rel="stylesheet" href="{% static "web/css/chart.css" %}" />
{% endblock %}
{% endblock %}
{% block content %}
<div id="main" class="container center-block statistics-title">
<h1 class="text-white text-center statistics-title">ユーザーログ統計情報</h1>
Expand Down Expand Up @@ -60,4 +60,4 @@ <h6 class="card-title">ルーム : 接続中</h5>
<div id="reaction_room" class="chart_content"></div>
</div>
<script src="{% static "web/js/chart.js" %}"></script>
{% endblock %}
{% endblock %}
10 changes: 5 additions & 5 deletions web/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{%block head%}{% endblock %}
{% load static %}
<link rel="icon"
type="image/png" sizes="32x32" href="{% static "web/favicon/favicon-32x32.png" %}">
type="image/png" sizes="32x32" href="{% static "web/favicon/favicon-32x32.png" %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static "web/favicon/favicon-16x16.png" %}">
<meta name="theme-color" content="#ffffff" />
<meta name="msapplication-TileColor" content="#da532c" />
Expand All @@ -24,11 +24,11 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://unpkg.com/simplebar@latest/dist/simplebar.css"/>
<script src="https://unpkg.com/simplebar@latest/dist/simplebar.min.js"></script>
<script src="{% static "web/js/bootstrap.min.js" %}"></script>
<script src="{% static "web/js/bootstrap.min.js" %}"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.0/font/bootstrap-icons.css">
<script src="{% static "web/js/jquery-3.6.0.js" %}"></script>
<script src="{% static "web/js/jquery-migrate.js" %}"></script>
<script src="{% static "web/js/flickity.min.js" %}"></script>
<script src="{% static "web/js/jquery-3.6.0.js" %}"></script>
<script src="{% static "web/js/jquery-migrate.js" %}"></script>
<script src="{% static "web/js/flickity.min.js" %}"></script>
<script src="https://unpkg.com/axios@1.0.0/dist/axios.min.js"></script>
{%block stylesheet%}{% endblock %}
</head>
Expand Down
Loading