Skip to content

Commit

Permalink
Merge pull request #10 from openvinotoolkit/main
Browse files Browse the repository at this point in the history
Update pre-commit links and some other minor fixes (openvinotoolkit#672)
  • Loading branch information
NagatoYuki0943 authored Nov 7, 2022
2 parents 1c47df3 + 3de3eef commit e22aed4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## Checklist

- [ ] My code follows the [pre-commit style and check guidelines](https://openvinotoolkit.github.io/anomalib/guides/using_pre_commit.html#pre-commit-hooks) of this project.
- [ ] My code follows the [pre-commit style and check guidelines](https://github.com/openvinotoolkit/anomalib/blob/main/CONTRIBUTING.md) of this project.
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
Expand Down
26 changes: 16 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,27 @@ pip install -r requirements/dev.txt

To enforce consistency within the repo, we use several formatters, linters, and style- and type checkers:

| Tool | Function | Documentation |
| ------ | -------------------------- | --------------------------------------- |
| Black | Code formatting | https://black.readthedocs.io/en/stable/ |
| isort | Organize import statements | https://pycqa.github.io/isort/ |
| Flake8 | Code style | https://flake8.pycqa.org/en/latest/ |
| Pylint | Linting | http://pylint.pycqa.org/en/latest/ |
| MyPy | Type checking | https://mypy.readthedocs.io/en/stable/ |
| Tool | Function | Documentation |
| ------ | -------------------------- | ----------------------------------------- |
| Black | Code formatting | <https://black.readthedocs.io/en/stable/> |
| isort | Organize import statements | <https://pycqa.github.io/isort/> |
| Flake8 | Code style | <https://flake8.pycqa.org/en/latest/> |
| Pylint | Linting | <http://pylint.pycqa.org/en/latest/> |
| MyPy | Type checking | <https://mypy.readthedocs.io/en/stable/> |

Instead of running each of these tools manually, we automatically run them before each commit and after each merge request. To achieve this we use pre-commit hooks and tox. Every developer is expected to use pre-commit hooks to make sure that their code remains free of typing and linting issues, and complies with the coding style requirements. When an MR is submitted, tox will be automatically invoked from the CI pipeline in Gitlab to check if the code quality is up to standard. Developers can also run tox locally before making an MR, though this is not strictly necessary since pre-commit hooks should be sufficient to prevent code quality issues. More detailed explanations of how to work with these tools is given in the respective guides:
Instead of running each of these tools manually, we automatically run them before each commit and after each merge request. To achieve this we use pre-commit hooks and tox. Every developer is expected to use pre-commit hooks to make sure that their code remains free of typing and linting issues, and complies with the coding style requirements. When a PR is submitted, tox will be automatically invoked from the CI pipeline in Gitlab to check if the code quality is up to standard. Developers can also run tox locally before making a PR, though this is not strictly necessary since pre-commit hooks should be sufficient to prevent code quality issues. More detailed explanations of how to work with these tools is given in the respective guides:

- Pre-commit hooks: [Pre-commit hooks guide](https://openvinotoolkit.github.io/anomalib/guides/using_pre_commit.html#pre-commit-hooks)
- Tox: [Using Tox](https://openvinotoolkit.github.io/anomalib/guides/using_tox.html#using-tox)
- Pre-commit hooks: [Pre-commit hooks guide](https://openvinotoolkit.github.io/anomalib/developer_guide/pre_commit_hooks.html)
- Tox: [Using Tox](https://openvinotoolkit.github.io/anomalib/developer_guide/using_tox.html)

In rare cases it might be desired to ignore certain errors or warnings for a particular part of your code. Flake8, Pylint and MyPy allow disabling specific errors for a line or block of code. The instructions for this can be found in the the documentations of each of these tools. Please make sure to only ignore errors/warnings when absolutely necessary, and always add a comment in your code stating why you chose to ignore it.

Before creating the PR, make sure you run the following to avoid pre-commit check fails.

```bash
tox -e pre-commit
```

## License

You accept that your contributions will be licensed under the [Apache-2.0 License](https://choosealicense.com/licenses/apache-2.0/) if you contribute to this repository. If this is a concern, please notify the maintainers.
Expand Down
21 changes: 9 additions & 12 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@ You can cite this repository as

.. code-block:: tex

@misc{anomalib,
title={Anomalib: A Deep Learning Library for Anomaly Detection},
author={Samet Akcay and
Dick Ameln and
Ashwin Vaidya and
Barath Lakshmanan and
Nilesh Ahuja and
Utku Genc},
year={2022},
eprint={2202.08341},
archivePrefix={arXiv},
primaryClass={cs.CV}
@INPROCEEDINGS{anomalib,
author={Akcay, Samet and Ameln, Dick and Vaidya, Ashwin and Lakshmanan, Barath and Ahuja, Nilesh and Genc, Utku},
booktitle={2022 IEEE International Conference on Image Processing (ICIP)},
title={Anomalib: A Deep Learning Library for Anomaly Detection},
year={2022},
volume={},
number={},
pages={1706-1710},
doi={10.1109/ICIP46576.2022.9897283}
}


Expand Down

0 comments on commit e22aed4

Please sign in to comment.