Add copyright pre-commit-hook (#1742)

* first commit

* Add copyright pre-commit-hook
pull/1545/head
Zaida Zhou 2022-02-24 09:24:25 +08:00 committed by GitHub
parent 0a8e67f753
commit 6e9ce18323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
119 changed files with 124 additions and 0 deletions

View File

@ -40,6 +40,12 @@ repos:
hooks: hooks:
- id: docformatter - id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"] args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0 # Use the ref you want to point at
hooks:
- id: check-copyright
args: ["mmcv", "tests", "--excludes", "mmcv/ops"]
# - repo: local # - repo: local
# hooks: # hooks:
# - id: clang-format # - id: clang-format

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import inspect import inspect
import platform import platform

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
import mmcv import mmcv

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .builder import RUNNER_BUILDERS, RUNNERS from .builder import RUNNER_BUILDERS, RUNNERS

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import onnx import onnx

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
# The 1.6 release of PyTorch switched torch.save to use a new zipfile-based # The 1.6 release of PyTorch switched torch.save to use a new zipfile-based
# file format. It will cause RuntimeError when a checkpoint was saved in # file format. It will cause RuntimeError when a checkpoint was saved in
# torch >= 1.6.0 but loaded in torch < 1.7.0. # torch >= 1.6.0 but loaded in torch < 1.7.0.

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import warnings import warnings
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2] item1 = [1, 2]
item2 = {'a': 0} item2 = {'a': 0}
item3 = True item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2] item1 = [1, 2]
item2 = {'a': 0} item2 = {'a': 0}
item3 = True item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2] item1 = [1, 2]
item2 = {'a': 0} item2 = {'a': 0}
item3 = True item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from mmcv import Config # isort:skip from mmcv import Config # isort:skip
cfg = Config.fromfile('./tests/data/config/a.py') cfg = Config.fromfile('./tests/data/config/a.py')

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './base.py' _base_ = './base.py'
item1 = [2, 3] item1 = [2, 3]
item2 = {'a': 1} item2 = {'a': 1}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './base.py' _base_ = './base.py'
item1 = {'a': 0, '_delete_': True} item1 = {'a': 0, '_delete_': True}
item2 = {'b': 0} item2 = {'b': 0}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './expected.py' _base_ = './expected.py'
_deprecation_ = dict( _deprecation_ = dict(

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './deprecated.py' _base_ = './deprecated.py'

View File

@ -1,2 +1,3 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './base.py' _base_ = './base.py'
item3 = {'a': 1} item3 = {'a': 1}

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = 'expected' item1 = 'expected'

View File

@ -1,2 +1,3 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './d.py' _base_ = './d.py'
item4 = 'test_recursive_bases' item4 = 'test_recursive_bases'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
filename = 'reserved.py' filename = 'reserved.py'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = '{{fileBasename}}' item1 = '{{fileBasename}}'
item2 = '{{ fileDirname}}' item2 = '{{ fileDirname}}'
item3 = 'abc_{{ fileBasenameNoExtension }}' item3 = 'abc_{{ fileBasenameNoExtension }}'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2] item1 = [1, 2]
item2 = {'a': 0} item2 = {'a': 0}
item3 = True item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './i_base.py' _base_ = './i_base.py'
item_cfg = {'b': 2} item_cfg = {'b': 2}
item6 = {'cfg': item_cfg} item6 = {'cfg': item_cfg}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py'] _base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py']
item3 = False item3 = False
item4 = 'test' item4 = 'test'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2] item1 = [1, 2]

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item5 = dict(a=0, b=1) item5 = dict(a=0, b=1)
item6 = [dict(a=0), dict(b=1)] item6 = [dict(a=0), dict(b=1)]
item7 = dict(a=[0, 1, 2], b=dict(c=[3.1, 4.2, 5.3])) item7 = dict(a=[0, 1, 2], b=dict(c=[3.1, 4.2, 5.3]))

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./l1.py', './l2.yaml', './l3.json', 'a.py'] _base_ = ['./l1.py', './l2.yaml', './l3.json', 'a.py']
item3 = False item3 = False
item4 = 'test' item4 = 'test'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
test_item1 = [1, 2] test_item1 = [1, 2]
bool_item2 = True bool_item2 = True
str_item3 = 'test' str_item3 = 'test'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
custom_imports = dict(imports=['r'], allow_failed_imports=False) custom_imports = dict(imports=['r'], allow_failed_imports=False)

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
os.environ["TEST_VALUE"] = 'test' os.environ["TEST_VALUE"] = 'test'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
item = [{'a': 0}, {'b': 0, 'c': 0}] item = [{'a': 0}, {'b': 0, 'c': 0}]

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py'] _base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py']
item3 = False item3 = False
item4 = 'test' item4 = 'test'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./t.py'] _base_ = ['./t.py']
base = '_base_.item8' base = '_base_.item8'
item11 = {{ _base_.item8 }} item11 = {{ _base_.item8 }}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./u.py'] _base_ = ['./u.py']
item21 = {{ _base_.item11 }} item21 = {{ _base_.item11 }}
item22 = item21 item22 = item21

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
#!/usr/bin/env python #!/usr/bin/env python
import argparse import argparse

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
from mmcv.cnn.bricks import Conv2dAdaptivePadding from mmcv.cnn.bricks import Conv2dAdaptivePadding

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import warnings import warnings
from unittest.mock import patch from unittest.mock import patch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
from mmcv.cnn.bricks import GeneralizedAttention from mmcv.cnn.bricks import GeneralizedAttention

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
from torch.nn.functional import relu6 from torch.nn.functional import relu6

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn import torch.nn as nn
import mmcv import mmcv

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import platform import platform

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
from mmcv.cnn.bricks import Scale from mmcv.cnn.bricks import Scale

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import copy import copy
import pytest import pytest

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from unittest.mock import patch from unittest.mock import patch
import pytest import pytest

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import os.path as osp import os.path as osp
import sys import sys

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import copy import copy
import numpy as np import numpy as np

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
from torch.autograd import gradcheck from torch.autograd import gradcheck

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
""" """
CommandLine: CommandLine:
pytest tests/test_corner_pool.py pytest tests/test_corner_pool.py

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import numpy as np import numpy as np

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
""" """
CommandLine: CommandLine:
pytest tests/test_merge_cells.py pytest tests/test_merge_cells.py

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import numpy import numpy

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import warnings import warnings
from functools import partial from functools import partial

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np import numpy as np
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import numpy as np import numpy as np

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch import torch
import torch.nn as nn import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch
from torch.autograd import gradcheck from torch.autograd import gradcheck

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch
from torch import nn from torch import nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import platform import platform

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
from functools import partial from functools import partial
from typing import Callable from typing import Callable

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
from functools import wraps from functools import wraps

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest import pytest
import torch import torch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os import os
import numpy as np import numpy as np

Some files were not shown because too many files have changed in this diff Show More