- Add mypy.ini configuration to exclude migration scripts - Rename migration files to proper snake_case (post-migration.py → post_migration.py) - Add __init__.py to migration directories for proper Python package structure - Add new portal access tests for website_sale_aplicoop - Code formatting improvements (black, isort) - Update copilot instructions and project configuration Related to previous code quality refactoring work.
40 lines
1 KiB
TOML
40 lines
1 KiB
TOML
[tool.black]
|
|
line-length = 88
|
|
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
|
|
include = '\.pyi?$'
|
|
extend-exclude = '''
|
|
/(
|
|
# directories
|
|
\.eggs
|
|
| \.git
|
|
| \.hg
|
|
| \.mypy_cache
|
|
| \.tox
|
|
| \.venv
|
|
| build
|
|
| dist
|
|
| setup
|
|
)/
|
|
'''
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
force_single_line = true
|
|
line_length = 88
|
|
multi_line_output = 3
|
|
include_trailing_comma = true
|
|
force_grid_wrap = 0
|
|
use_parentheses = true
|
|
ensure_newline_before_comments = true
|
|
skip_glob = ["*/__init__.py"]
|
|
known_odoo = ["odoo"]
|
|
known_odoo_addons = ["odoo.addons"]
|
|
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "ODOO", "ODOO_ADDONS", "FIRSTPARTY", "LOCALFOLDER"]
|
|
default_section = "THIRDPARTY"
|
|
|
|
[tool.mypy]
|
|
# Excluir carpetas de migraciones y archivos de post-migrate.py que usan guiones
|
|
# (evita errores de "Duplicate module" en mypy cuando múltiples addons contienen
|
|
# archivos con el mismo nombre como `post-migrate.py`). Usamos una expresión
|
|
# regular que coincide con cualquier ruta que contenga `/migrations/`.
|
|
exclude = "(?i).*/migrations/.*"
|