Skip to content
This repository was archived by the owner on Dec 6, 2025. It is now read-only.
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
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [ {
"name": "Debug Verity",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/src/verity.py",
"console": "integratedTerminal",
"justMyCode": true,
"cwd": "${workspaceFolder}/src",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"preLaunchTask": "UV Sync "
}
]
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestPath": "pytest",
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"editor.formatOnSaveMode": "file", "python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/Scripts/python.exe",
"editor.defaultFormatter": "charliermarsh.ruff",
"ruff.enable": true,
"ruff.organizeImports": true,
}
82 changes: 82 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"version": "2.0.0",
"tasks": [ {
"label": "Run Tests",
"type": "shell",
"command": "uv run pytest",
"options": {
"cwd": "${workspaceFolder}/src"
},
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true,
"focus": true
},
"problemMatcher": []
}, {
"label": "Run Linter (Ruff Check)",
"type": "shell",
"command": "ruff check",
"options": {
"cwd": "${workspaceFolder}/src"
},
"group": "test",
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true,
"focus": true
},
"problemMatcher": []
}, {
"label": "Pre-commit Check (Tests + Lint)",
"dependsOrder": "sequence",
"dependsOn": [ "Run Tests", "Run Linter (Ruff Check)"],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Run Verity",
"type": "shell",
"command": "uv run verity.py",
"options": {
"cwd": "${workspaceFolder}/src"
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true,
"focus": true
}, "problemMatcher": []
},
{
"label": "UV Sync ",
"type": "shell",
"command": "uv sync",
"options": {
"cwd": "${workspaceFolder}"
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true,
"focus": true
},
"problemMatcher": []
}
]
}
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ requires-python = ">=3.13"
dependencies = [
"flask>=3.1.0",
"pytest>=8.3.5",
"python-lsp-ruff>=2.2.2",
"python-lsp-server>=1.12.2",
"pyyaml>=6.0.2",
"requests>=2.32.3",
"ruff>=0.11.9",
Expand All @@ -17,3 +19,24 @@ testspaths = ["tests"]
python_files = "test_*.py"
python_functions = "test_*"

[tool.pylsp]
plugins.ruff.enabled = true
plugins.ruff.format = ["I"] # Use ruff to organize imports
plugins.ruff.lineLength = 100
plugins.rope_completion.enabled = true
plugins.rope_autoimport.enabled = true
plugins.jedi_completion.enabled = true
plugins.jedi_definition.enabled = true

[tool.ruff]
line-length = 100
target-version = "py313"

[tool.ruff.lint]
select = ["E", "F", "I", "W"] # Error, F: PyFlakes, I: isort, W: pycodestyle warnings
ignore = []

# Also organize imports
[tool.ruff.lint.isort]
known-first-party = ["verity"]

1 change: 1 addition & 0 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import yaml


Expand Down
2 changes: 1 addition & 1 deletion src/data_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sqlite3
import logging
import sqlite3

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions src/front/home.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flask import Blueprint, render_template
from flask import flash, redirect, url_for, session, request
import logging

from flask import Blueprint, flash, redirect, render_template, request, session, url_for

import data_handler
from config import VerityConfig

Expand Down
4 changes: 3 additions & 1 deletion src/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from src import config
import os

import yaml

from src import config


def test_verity_config_default_secret_key(monkeypatch):
"""Test that the default secret key is used
Expand Down
4 changes: 2 additions & 2 deletions src/verity.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import atexit
import logging
import logging.config
import atexit
import os

from flask import Flask

Expand Down
Loading