Style and Linting
Linting
DASCore uses Black and flake8 for code linting. If you have properly installed DASCore’s pre-commit hooks they will be invoked automatically when you make a git commit. If any complaints are raised simply address them and try again.
Alternatively, before making a commit, you can run all the hooks on all the code like so:
pre-commit run --all
It is often useful to run this command twice before making changes because many of the hooks will automatically fix the issue they raise on the first run.
Type Hints
DASCore makes extensive use of Python 3’s type hints. Use them to annotate any public functions/methods. See the docstring section of the documentation page for more information and some examples.
The hints are checked by ty as part of the pre-commit hooks. ty always checks the whole dascore package (not just changed files); its configuration lives in pyproject.toml under [tool.ty]. Several rules with large pre-existing error counts are temporarily ignored there and will be re-enabled incrementally — please don’t add new type errors in the categories that are already enforced.