We welcome your input! 👐
We want to make it as simple and straightforward as possible to contribute to this project, whether it is a:
- Bug Report
- Discussion
- Feature Request
- Creating a Pull Request (PR)
- Becoming a maintainer
We use GitHub issues to track the bugs. Report a bug by using our Bug Report Template in Issues.
We enabled GitHub Discussions in anomalib to welcome the community to ask questions and/or propose ideas/solutions. This will not only provide a medium to the community to discuss about anomalib but also help us de-clutter Issues.
We utilize GitHub issues to track the feature requests as well. If you are certain regarding the feature you are interested and have a solid proposal, you could then create the feature request by using our Feature Request Template in Issues. If it's still in an idea phase, you could then discuss that with the community in our Discussion.
We actively welcome your pull requests:
- Fork the repo and create your branch from
main
. - Set up the development environment by following the instructions below.
- If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Ensure the test suite passes.
- Make sure you own the code you're submitting or that you obtain it from a source with an appropriate license.
- Add a summary of the changes to the CHANGELOG (not for minor changes, docs and tests).
- Issue that pull request!
To setup the development environment, you will need to install development requirements, as well as the base requirements of the library.
conda create -n anomalib_dev python=3.10
conda activate anomalib_dev
pip install -r requirements/base.txt -r requirements/dev.txt
pre-commit install
The commands above will install pre-commit. Pre-commit hooks will run each of the code quality tools listed above each time you commit some changes to a branch. Some tools like black and isort will automatically format your files to enforce consistent formatting within the repo. Other tools will provide a list of errors and warnings which you will be required to address before being able to make the commit.
The pre-commit checks can also be triggered manually with the following command:
pre-commit run --all-files
In some cases it might be desired to commit your changes even though some of the checks are failing. For example when you want to address the pre-commit issues at a later time, or when you want to commit a work-in-progress. In these cases, you can skip the pre-commit hooks by adding the --no-verify
parameter to the commit command.
git commit -m 'WIP commit' --no-verify
When doing so, please make sure to revisit the pre-commit issues before you submit your PR. A good way to confirm if your code passes the checks is by running pre-commit run --all-files
.
More information on pre-commit and how it is used in Anomalib can be found in our documentation:
You accept that your contributions will be licensed under the Apache-2.0 License if you contribute to this repository. If this is a concern, please notify the maintainers.
This document was adapted from here.