- Implement tests for counting emails in single and multiple folders, including handling of empty folders and error scenarios in `test_count_imap_emails.py`. - Create tests for environment variable verification, IMAP connection handling, folder normalization, MIME header decoding, and message details extraction in `test_imap_common.py`. - Develop tests for email migration, including duplicate detection, deletion from source after migration, folder creation on destination, and handling of multiple folders in `test_migrate_imap_emails.py`. - Introduce a mock IMAP server to facilitate testing of IMAP functionalities in `tools/mock_imap_server.py`.
64 lines
1.6 KiB
TOML
64 lines
1.6 KiB
TOML
# Ruff configuration for IMAP Migration Tools
|
|
# https://docs.astral.sh/ruff/
|
|
|
|
[tool.ruff]
|
|
target-version = "py39"
|
|
line-length = 120
|
|
|
|
# Include src, tools, and test directories
|
|
src = ["src", "tools", "test"]
|
|
|
|
[tool.ruff.lint]
|
|
# Enable recommended rules
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"W", # pycodestyle warnings
|
|
"F", # Pyflakes
|
|
"I", # isort
|
|
"B", # flake8-bugbear
|
|
"C4", # flake8-comprehensions
|
|
"UP", # pyupgrade
|
|
]
|
|
|
|
ignore = [
|
|
"E501", # line too long (handled by formatter)
|
|
"E701", # multiple statements on one line (colon) - used for concise code
|
|
"E722", # bare except - used in connection handling
|
|
"B008", # do not perform function calls in argument defaults
|
|
"B905", # zip without explicit strict parameter
|
|
"F841", # local variable assigned but never used - used for clarity
|
|
"W293", # blank line contains whitespace - handled by formatter
|
|
]
|
|
|
|
# Allow unused variables when underscore-prefixed
|
|
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"test/*.py" = [
|
|
"S101", # assert statements are fine in tests
|
|
]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "double"
|
|
indent-style = "space"
|
|
skip-magic-trailing-comma = false
|
|
line-ending = "auto"
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["test"]
|
|
python_files = ["test_*.py"]
|
|
python_classes = ["Test*"]
|
|
python_functions = ["test_*"]
|
|
addopts = "-v --tb=short"
|
|
|
|
[tool.coverage.run]
|
|
source = ["src"]
|
|
omit = ["test/*", "tools/*"]
|
|
|
|
[tool.coverage.report]
|
|
exclude_lines = [
|
|
"pragma: no cover",
|
|
"if __name__ == .__main__.:",
|
|
"raise NotImplementedError",
|
|
]
|