Developer documentation
Please refer to the scanpy developer guide.
Pre-commit documentation
Pre-commit checks are fast programs that check code for errors, inconsistencies and code styles, before the code is committed. This is a brief documentation of pre-commits checks pre-sets in the scverse-template.
The following pre-commit checks for code style and format.
black: standard code formatter in Python.
isort: sort module imports into sections and types.
prettier: standard code formatter for non-Python files (e.g. YAML).
blacken-docs: black on python code in docs.
The following pre-commit checks for errors, inconsistencies and typing.
flake8: standard check for errors in Python files.
flake8-tidy-imports: tidy module imports.
flake8-docstrings: pydocstyle extension of flake8.
flake8-rst-docstrings: extension of
flake8-docstringsforrstdocs.flake8-comprehensions: write better list/set/dict comprehensions.
flake8-bugbear: find possible bugs and design issues in program.
flake8-blind-except: checks for blind, catch-all
exceptstatements.
yesqa: remove unneccesary
# noqacomments, follows additional dependencies listed above.autoflake: remove unused imports and variables.
pre-commit-hooks: generic pre-commit hooks.
detect-private-key: checks for the existence of private keys.
check-ast: check whether files parse as valid python.
end-of-file-fixer:check files end in a newline and only a newline.
mixed-line-ending: checks mixed line ending.
trailing-whitespace: trims trailing whitespace.
check-case-conflict: check files that would conflict with case-insensitive file systems.
pyupgrade: upgrade syntax for newer versions of the language.
Notes on pre-commit checks
flake8: to ignore errors, you can add a comment
# noqato the offending line. You can also specify the error id to ignore with e.g.# noqa: E731. Check flake8 guide for reference.You can add or remove pre-commit checks by simply deleting relevant lines in the
.pre-commit-config.yamlfile. Some pre-commit checks have additional options that can be specified either in thepyproject.tomlor pre-commit specific config files, such as.prettierrc.ymlfor prettier and.flake8for flake8.