Skip to content

Commit

Permalink
[Enhance] add pre-commit hook for algo-readme and copyright (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyixiao18 authored Feb 18, 2022
1 parent af331b0 commit 7d70d96
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
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

0 comments on commit 7d70d96

Please sign in to comment.