Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhance] add pre-commit hook for algo-readme and copyright #213

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ repos:
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0
hooks:
- id: check-algo-readme
- id: check-copyright
args: ["mmselfsup", "tools", "tests"]
3 changes: 3 additions & 0 deletions mmselfsup/utils/clustering.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.

# This file is modified from
# https://github.com/facebookresearch/deepcluster/blob/master/clustering.py

Expand Down
3 changes: 3 additions & 0 deletions mmselfsup/utils/distributed_sinkhorn.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.

# This file is modified from
# https://github.com/facebookresearch/swav/blob/main/main_swav.py

Expand Down
1 change: 1 addition & 0 deletions tests/test_data/test_data_sources/test_image_list.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_data/test_data_sources/test_imagenet.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_data/test_datasets/test_builder.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from unittest.mock import ANY

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_runtime/test_hooks/test_optimizer_hook.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import logging
import tempfile
from unittest.mock import MagicMock
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils/test_clustering.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from unittest.mock import patch

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils/test_test_helper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from unittest.mock import MagicMock

import numpy as np
Expand Down