Skip to content

Commit 3eeba11

Browse files
committed
feat: global project update
1 parent 6bff07c commit 3eeba11

63 files changed

Lines changed: 3159 additions & 499 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[flake8]
2+
max-line-length = 88
3+
ignore =
4+
W503,
5+
ANN002, ANN003, ANN101, ANN102, ANN204, ANN401,
6+
F405,
7+
A003,
8+
9+
exclude =
10+
.git
11+
__pycache__
12+
venv
13+
solutions
14+
15+
per-file-ignores =
16+
src/nodes/list_node.py: A002

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10"]
15+
16+
steps:
17+
# Загрузка кода
18+
- uses: actions/checkout@v4
19+
20+
# Установка Python
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
# Кеширование зависимостей
26+
- uses: actions/cache@v3
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
30+
31+
# Установка зависимостей
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt -r requirements-dev.txt
36+
37+
# Запуск линтеров
38+
- name: Run Black
39+
run: black src/ --check
40+
41+
- name: Run isort
42+
run: isort src/ --check-only
43+
44+
- name: Run flake8
45+
run: flake8 src/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ env/
2727

2828
# Log files:
2929
*.log
30+
31+
# Project:
32+
solutions/*
33+
!solutions/example/

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-ast # Проверка корректности Python-файлов
6+
- id: trailing-whitespace # Удаляет пробелы в конце строк
7+
- id: end-of-file-fixer # Добавляет пустую строку в конец файла
8+
- id: check-yaml # Проверяет синтаксис YAML
9+
- id: check-toml # Проверяет синтаксис TOML
10+
- id: check-json # Проверяет синтаксис JSON
11+
- id: name-tests-test # Проверяет имена тестов
12+
- id: requirements-txt-fixer # Сортировка requirements.txt
13+
14+
- repo: https://github.com/psf/black
15+
rev: 25.1.0
16+
hooks:
17+
- id: black # Форматирование кода
18+
19+
- repo: https://github.com/PyCQA/isort
20+
rev: 6.0.1
21+
hooks:
22+
- id: isort # Сортировка импортов
23+
24+
- repo: https://github.com/PyCQA/flake8
25+
rev: 7.2.0
26+
hooks:
27+
- id: flake8 # Линтер
28+
additional_dependencies: [
29+
flake8-bugbear,
30+
flake8-comprehensions,
31+
flake8-annotations,
32+
flake8-builtins,
33+
flake8-json,
34+
]

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2025 vladisnut
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 574 additions & 0 deletions
Large diffs are not rendered by default.

assets/templates/settings.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
from typing import Any, Callable, Sequence, Type
2+
3+
4+
def runner(target: Type | Callable, args: Sequence) -> Any:
5+
"""
6+
Пользовательская настройка запуска тестируемой цели.
7+
8+
:param target: Тестируемая цель (функция или класс).
9+
:param args: Аргументы теста.
10+
:returns: Результат выполнения кода.
11+
"""
12+
pass
13+
14+
15+
def validator(
16+
args_before: Sequence, args_after: Sequence, expected: Any, result: Any
17+
) -> bool:
18+
"""
19+
Валидация результата теста.
20+
21+
:param args_before: Аргументы до выполнения кода.
22+
:param args_after: Аргументы после выполнения кода.
23+
:param expected: Ожидаемый результат.
24+
:param result: Результат выполнения кода.
25+
:returns: True, если тест пройден, иначе False.
26+
"""
27+
pass
28+
29+
30+
def generator() -> tuple[Sequence, Any]:
31+
"""
32+
Генерация тестового случая.
33+
34+
:returns: Кортеж из двух элементов:
35+
последовательность аргументов теста, ожидаемое значение.
36+
"""
37+
pass
38+
39+
40+
# Допустимые значения:
41+
# имя функции, класса или метода класса (в формате ClassName.methodName)
42+
TARGET = None
43+
44+
# Допустимые значения:
45+
# "function", "method", "class", "stream"
46+
TESTER = None
47+
48+
# RUNNER = runner
49+
50+
# VALIDATOR = validator
51+
52+
TESTS = [
53+
# {
54+
# 'args': [],
55+
# 'expected': None
56+
# },
57+
# {
58+
# 'generator': generator,
59+
# 'count': 100
60+
# },
61+
]

assets/templates/solution/class.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Solution:
2+
def execute(self) -> None:
3+
pass
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def solution() -> None:
2+
pass
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def main() -> None:
2+
nums = tuple(map(int, input().split()))
3+
print(" ".join(map(str, nums)))
4+
5+
6+
if __name__ == "__main__":
7+
main()

0 commit comments

Comments
 (0)