Asib27's picture
try 1
065fee7 verified
raw
history blame
2.67 kB
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
addopts = "--cov=git --cov-report=term --disable-warnings -ra"
filterwarnings = "ignore::DeprecationWarning"
python_files = "test_*.py"
tmp_path_retention_policy = "failed"
testpaths = "test" # Space separated list of paths from root e.g test tests doc/testing.
# --cov coverage
# --cov-report term # send report to terminal term-missing -> terminal with line numbers html xml
# --cov-report term-missing # to terminal with line numbers
# --cov-report html:path # html file at path
# --maxfail # number of errors before giving up
# -disable-warnings # Disable pytest warnings (not codebase warnings)
# -rfE # default test summary: list fail and error
# -ra # test summary: list all non-passing (fail, error, skip, xfail, xpass)
# --ignore-glob=**/gitdb/* # ignore glob paths
# filterwarnings ignore::WarningType # ignores those warnings
[tool.mypy]
python_version = "3.8"
files = ["git/", "test/deprecation/"]
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true # Useful in general, but especially in test/deprecation.
warn_unreachable = true
implicit_reexport = true
# strict = true
# TODO: Remove when 'gitdb' is fully annotated.
exclude = ["^git/ext/gitdb"]
[[tool.mypy.overrides]]
module = "gitdb.*"
ignore_missing_imports = true
[tool.coverage.run]
source = ["git"]
[tool.coverage.report]
include = ["*/git/*"]
omit = ["*/git/ext/*"]
[tool.ruff]
target-version = "py37"
line-length = 120
# Exclude a variety of commonly ignored directories.
exclude = [
"git/ext/",
"build",
"dist",
]
# Enable Pyflakes `E` and `F` codes by default.
lint.select = [
"E",
"W", # See: https://pypi.org/project/pycodestyle
"F", # See: https://pypi.org/project/pyflakes
# "I", # See: https://pypi.org/project/isort/
# "S", # See: https://pypi.org/project/flake8-bandit
# "UP", # See: https://docs.astral.sh/ruff/rules/#pyupgrade-up
]
lint.extend-select = [
# "A", # See: https://pypi.org/project/flake8-builtins
"B", # See: https://pypi.org/project/flake8-bugbear
"C4", # See: https://pypi.org/project/flake8-comprehensions
"TCH004", # See: https://docs.astral.sh/ruff/rules/runtime-import-in-type-checking-block/
]
lint.ignore = [
"E203", # Whitespace before ':'
"E731", # Do not assign a `lambda` expression, use a `def`
]
lint.ignore-init-module-imports = true
lint.unfixable = [
"F401", # Module imported but unused
]
[tool.ruff.lint.per-file-ignores]
"test/**" = [
"B018", # useless-expression
]